diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts index db6138f8e..0279f6514 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/state.ts @@ -47,7 +47,7 @@ export function useComponentState( ? undefined : await api.getExchangeDetailedInfo(initialExchange.exchangeBaseUrl); return { exchanges, selected, original }; - }); + }, [value]); if (!hook) { return { @@ -67,13 +67,14 @@ export function useComponentState( if (!selected) { //!selected <=> exchanges.length === 0 return { - status: "no-exchanges", + status: "no-exchange", error: undefined, + currency: undefined, }; } const exchangeMap = exchanges.reduce( - (prev, cur, idx) => ({ ...prev, [cur.exchangeBaseUrl]: String(idx) }), + (prev, cur, idx) => ({ ...prev, [String(idx)]: cur.exchangeBaseUrl }), {} as Record<string, string>, ); |