diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/NavigationBar.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/NavigationBar.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/NavigationBar.tsx b/packages/taler-wallet-webextension/src/NavigationBar.tsx index dd2d31c3d..231418861 100644 --- a/packages/taler-wallet-webextension/src/NavigationBar.tsx +++ b/packages/taler-wallet-webextension/src/NavigationBar.tsx @@ -84,7 +84,7 @@ function pageDefinition<T extends object>(pattern: string): PageLocation<T> { return { ...prev, [name]: cur }; }, {} as Record<string, string>); - const f = (values: T): string => replaceAll(pattern, vars, values); + const f = (values: T): string => replaceAll(pattern, vars, values ?? {}); f.pattern = pattern; return f; } @@ -152,6 +152,7 @@ const talerUriActionToPageName: { [TalerUriAction.PayPush]: "ctaTransferPickup", [TalerUriAction.Restore]: "ctaRecovery", [TalerUriAction.PayTemplate]: "ctaPayTemplate", + [TalerUriAction.WithdrawExchange]: "ctaWithdrawManual", [TalerUriAction.DevExperiment]: undefined, [TalerUriAction.Exchange]: undefined, [TalerUriAction.Auditor]: undefined, @@ -166,7 +167,11 @@ export function getPathnameForTalerURI(talerUri: string): string | undefined { if (!pageName) { return undefined; } - return `${Pages[pageName]}?talerUri=${encodeURIComponent(talerUri)}`; + const pageString: string = + typeof Pages[pageName] === "function" + ? (Pages[pageName] as any)() + : Pages[pageName]; + return `${pageString}?talerUri=${encodeURIComponent(talerUri)}`; } export type PopupNavBarOptions = "balance" | "backup" | "dev"; |