diff options
author | Sebastian <sebasjm@gmail.com> | 2023-03-29 00:06:24 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-03-29 00:06:24 -0300 |
commit | efbde0e16033542ae104f5365be5cee6e65ef7b0 (patch) | |
tree | 65129a0a7e9a9791fcd38343841878a54ad49bf6 /packages/taler-wallet-webextension | |
parent | f414ca39e446563eb10c3c20defe79952fe71e6a (diff) |
handle kyc error on invoice and transfer
Diffstat (limited to 'packages/taler-wallet-webextension')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx | 21 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/Transaction.tsx | 15 |
2 files changed, 22 insertions, 14 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx index 2db2041d4..339e69213 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx @@ -140,12 +140,19 @@ export function View({ }); } const api = useBackendContext(); + const fileRef = useRef<HTMLInputElement>(null); async function onImportDatabase(str: string): Promise<void> { return api.wallet.call(WalletApiOperation.ImportDb, { dump: JSON.parse(str), }); } + + const hook = useAsyncAsHook(() => + api.wallet.call(WalletApiOperation.ListExchanges, {}), + ); + const exchangeList = hook && !hook.hasError ? hook.response.exchanges : []; + const currencies: { [ex: string]: string } = {}; const money_by_exchange = coins.reduce( (prev, cur) => { @@ -171,7 +178,6 @@ export function View({ [exchange_name: string]: CalculatedCoinfInfo[]; }, ); - const exchanges = Object.keys(money_by_exchange); const [tagName, setTagName] = useState(""); const [logLevel, setLogLevel] = useState("info"); @@ -324,27 +330,28 @@ export function View({ variant="contained" onClick={async () => { const result = await Promise.all( - exchanges.map(async (ex) => { + exchangeList.map(async (exchange) => { + const url = exchange.exchangeBaseUrl; const oldKeys = JSON.stringify( - await (await fetch(`${ex}keys`)).json(), + await (await fetch(`${url}keys`)).json(), ); const oldWire = JSON.stringify( - await (await fetch(`${ex}wire`)).json(), + await (await fetch(`${url}wire`)).json(), ); const newKeys = JSON.stringify( await ( - await fetch(`${ex}keys`, { cache: "no-cache" }) + await fetch(`${url}keys`, { cache: "no-cache" }) ).json(), ); const newWire = JSON.stringify( await ( - await fetch(`${ex}wire`, { cache: "no-cache" }) + await fetch(`${url}wire`, { cache: "no-cache" }) ).json(), ); return oldKeys !== newKeys || newWire !== oldWire; }), ); - const ex = exchanges.filter((e, i) => result[i]); + const ex = exchangeList.filter((e, i) => result[i]); if (!ex.length) { alert("no exchange was outdated"); } else { diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index b9b1aa198..217a77575 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -879,13 +879,14 @@ export function TransactionView({ kind="neutral" /> {transaction.extendedStatus === - ExtendedStatus.Pending /** pending is not-pay */ && ( - <Part - title={i18n.str`URI`} - text={<ShowQrWithCopy text={transaction.talerUri} />} - kind="neutral" - /> - )} + ExtendedStatus.Pending /** pending is not-pay */ && + !transaction.error && ( + <Part + title={i18n.str`URI`} + text={<ShowQrWithCopy text={transaction.talerUri} />} + kind="neutral" + /> + )} <Part title={i18n.str`Details`} text={ |