diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx b/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx index 0c8336e69..6dbdf4c30 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeAddPage.tsx @@ -47,8 +47,15 @@ export function ExchangeAddPage({ onBack }: Props): VNode { return ( <ExchangeSetUrlPage onCancel={onBack} - knownExchanges={knownExchanges} - onVerify={(url) => queryToSlashKeys(url)} + onVerify={async (url) => { + const found = + knownExchanges.findIndex((e) => e.exchangeBaseUrl === url) !== -1; + + if (found) { + throw Error("This exchange is already known"); + } + return queryToSlashKeys(url); + }} onConfirm={(url) => queryToSlashKeys<TalerConfigResponse>(url) .then((config) => { |