From 32cd54e11d80bde0274b3c0238f8f5bd00ff83cb Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 21 Mar 2022 12:49:41 -0300
Subject: fix: handle new optional parameter for settings_exchange_add page

---
 .../src/wallet/CreateManualWithdraw.tsx                        | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

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

diff --git a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
index 1996687ba..068135ae0 100644
--- a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
@@ -67,9 +67,9 @@ export function useComponentState(
   const initialExchange =
     foundExchangeForCurrency !== -1
       ? exchangeSelectList[foundExchangeForCurrency]
-      : // : exchangeSelectList.length > 0
-        // ? exchangeSelectList[0]
-        undefined;
+      : !initialCurrency && exchangeSelectList.length > 0
+      ? exchangeSelectList[0]
+      : undefined;
 
   const [exchange, setExchange] = useState(initialExchange || "");
   const [currency, setCurrency] = useState(
@@ -188,7 +188,7 @@ export function CreateManualWithdraw({
             <i18n.Translate>No exchange configured</i18n.Translate>
           </BoldLight>
           <LinkPrimary
-            href={Pages.settings_exchange_add}
+            href={Pages.settings_exchange_add.replace(":currency?", "")}
             style={{ marginLeft: "auto" }}
           >
             <i18n.Translate>Add Exchange</i18n.Translate>
@@ -234,7 +234,7 @@ export function CreateManualWithdraw({
           </Input>
           <div style={{ display: "flex", justifyContent: "space-between" }}>
             <LinkPrimary
-              href={Pages.settings_exchange_add}
+              href={Pages.settings_exchange_add.replace(":currency?", "")}
               style={{ marginLeft: "auto" }}
             >
               <i18n.Translate>Add Exchange</i18n.Translate>
-- 
cgit v1.2.3

