From fb22009ec4799a624f00c228fbd7435b44c1cbac Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Mon, 10 Jan 2022 16:04:53 -0300
Subject: deposit design from belen, feature missing: kyc

---
 .../src/wallet/CreateManualWithdraw.tsx                      | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(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 36feeb76e..f32a2aa5c 100644
--- a/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/CreateManualWithdraw.tsx
@@ -41,12 +41,14 @@ export interface Props {
   exchangeList: Record<string, string>;
   onCreate: (exchangeBaseUrl: string, amount: AmountJson) => Promise<void>;
   onAddExchange: () => void;
+  initialCurrency?: string;
 }
 
 export function CreateManualWithdraw({
   initialAmount,
   exchangeList,
   error,
+  initialCurrency,
   onCreate,
   onAddExchange,
 }: Props): VNode {
@@ -61,8 +63,16 @@ export function CreateManualWithdraw({
     {} as Record<string, string>,
   );
 
+  const foundExchangeForCurrency = exchangeSelectList.findIndex(
+    (e) => exchangeList[e] === initialCurrency,
+  );
+
   const initialExchange =
-    exchangeSelectList.length > 0 ? exchangeSelectList[0] : "";
+    foundExchangeForCurrency !== -1
+      ? exchangeSelectList[foundExchangeForCurrency]
+      : exchangeSelectList.length > 0
+      ? exchangeSelectList[0]
+      : "";
 
   const [exchange, setExchange] = useState(initialExchange || "");
   const [currency, setCurrency] = useState(exchangeList[initialExchange] ?? "");
-- 
cgit v1.2.3

