From 5d0837913901a2947c66209d64855b324824757d Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 16 Sep 2022 11:06:55 -0300 Subject: working on #7357 getTransactionById is introduced: with that we move all transaction information building into a function transactionId was added in every response that creates a tx --- .../src/wallet/DeveloperPage.stories.tsx | 1 + packages/taler-wallet-webextension/src/wallet/Transaction.tsx | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'packages/taler-wallet-webextension/src/wallet') diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx index 1a5d72337..ae1581009 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx @@ -35,6 +35,7 @@ export const AllOff = createExample(TestedComponent, { onDownloadDatabase: async () => "this is the content of the database", operations: [ { + id: "", type: PendingTaskType.ExchangeUpdate, exchangeBaseUrl: "http://exchange.url.", givesLifeness: false, diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index 3d2a16e8f..21cee8789 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -70,13 +70,8 @@ interface Props { } async function getTransaction(tid: string): Promise { - const res = await wxApi.getTransactions(); - const ts = res.transactions.filter((t) => t.transactionId === tid); - if (ts.length > 1) throw Error("more than one transaction with this id"); - if (ts.length === 1) { - return ts[0]; - } - throw Error("no transaction found"); + const res = await wxApi.getTransactionById(tid); + return res; } export function TransactionPage({ tid, goToWalletHistory }: Props): VNode { -- cgit v1.2.3