From e227fa4e47a86c368011b063d3ac5ec005dc7652 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 13 Oct 2021 06:40:16 -0300
Subject: fix tests and added addExchange

---
 .../taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

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

diff --git a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
index 35cea2b9f..dcc0002e6 100644
--- a/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/ManualWithdrawPage.tsx
@@ -38,7 +38,13 @@ export function ManualWithdrawPage({ }: Props): VNode {
     try {
       const r = await fetch(`${exchange}/keys`)
       const j = await r.json()
-      setCurrency(j.currency)
+      if (j.currency) {
+        await wxApi.addExchange({
+          exchangeBaseUrl: `${exchange}/`,
+          forceUpdate: true
+        })
+        setCurrency(j.currency)
+      }
     } catch (e) {
       setError('The exchange url seems invalid')
       setCurrency(undefined)
-- 
cgit v1.2.3

