From 021d508337490d25f6d7293bf0deadbb5f298f8c Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 13 Oct 2021 09:54:18 -0300
Subject: fix cta navbar and added an withdrawal button when the wallet didnt
 find a tos (with a warning)

---
 .../taler-wallet-webextension/src/popupEntryPoint.tsx  | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'packages/taler-wallet-webextension/src/popupEntryPoint.tsx')

diff --git a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
index 33a462142..070df554c 100644
--- a/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
+++ b/packages/taler-wallet-webextension/src/popupEntryPoint.tsx
@@ -66,14 +66,9 @@ if (document.readyState === "loading") {
 function Application() {
   const [talerActionUrl, setDismissed] = useTalerActionURL()
 
-  if (talerActionUrl) {
-    return <div>
-      <WalletNavBar />
-      <div style={{ width: 400, height: 290 }}>
-        <TalerActionFound url={talerActionUrl} onDismiss={setDismissed} />
-      </div>
-    </div>
-  }
+  useEffect(() => {
+    if (talerActionUrl) route(Pages.cta)
+  },[talerActionUrl])
 
   return (
     <div>
@@ -81,11 +76,16 @@ function Application() {
         <WalletNavBar />
         <div style={{ width: 400, height: 290 }}>
           <Router history={createHashHistory()}>
+            <Route path={Pages.dev} component={DeveloperPage} />
+
             <Route path={Pages.balance} component={BalancePage}
               goToWalletManualWithdraw={() => goToWalletPage(Pages.manual_withdraw)}
             />
             <Route path={Pages.settings} component={SettingsPage} />
-            <Route path={Pages.dev} component={DeveloperPage} />
+            <Route path={Pages.cta} component={() => <TalerActionFound url={talerActionUrl!} onDismiss={() => {
+              setDismissed(true)
+              route(Pages.balance)
+            }} />} />
 
             <Route path={Pages.transaction}
               component={({ tid }: { tid: string }) => goToWalletPage(Pages.transaction.replace(':tid', tid))}
-- 
cgit v1.2.3

