Threema QR: on-demand modal + auto-open on first add
All checks were successful
Build and Push / build (push) Successful in 1m29s
All checks were successful
Build and Push / build (push) Successful in 1m29s
This commit is contained in:
33
src/lib/threema-gateway-config.ts
Normal file
33
src/lib/threema-gateway-config.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Threema central gateway info shown to customers.
|
||||
*
|
||||
* Today PieCed runs exactly one Threema Gateway account (*AIAGENT) and
|
||||
* every tenant talks to that. The constants below are hardcoded for
|
||||
* that account. The values are intentionally kept here (and not split
|
||||
* across i18n / env / runtime config) so when we move to multiple
|
||||
* gateway accounts there's a single file to refactor.
|
||||
*
|
||||
* To go dynamic (future):
|
||||
* 1. Replace `THREEMA_GATEWAY` constant with a runtime lookup —
|
||||
* either per-tenant from the relay's admin API, or from an
|
||||
* env var that lists the active account.
|
||||
* 2. Move the QR PNG into a server-rendered route that takes a
|
||||
* gateway ID query param.
|
||||
* 3. Update consumers (today only ThreemaSetup) to accept the
|
||||
* gateway info as a prop and pass it from a server component.
|
||||
*
|
||||
* In display contexts we strip the leading asterisk from the Threema
|
||||
* ID — customers don't understand the `*X` prefix convention used for
|
||||
* Gateway accounts, and the QR code carries the real value anyway. We
|
||||
* keep the asterisk only for places where the technical value matters
|
||||
* (server-side message routing, debug logs).
|
||||
*/
|
||||
|
||||
export const THREEMA_GATEWAY = {
|
||||
/** Technical Threema Gateway ID, with leading asterisk. */
|
||||
id: "*AIAGENT",
|
||||
/** Display name shown to customers (no asterisk). */
|
||||
displayName: "AIAGENT",
|
||||
/** Public path to the QR code PNG served from `public/`. */
|
||||
qrCodePath: "/threema/qr_code_AIAGENT.png",
|
||||
} as const;
|
||||
Reference in New Issue
Block a user