From c166f98aeb744a31cb0ae8d6d7d294fc2eae0b1f Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 12 Feb 2024 16:58:30 -0300 Subject: fixes #8228 --- .../src/components/BalanceTable.tsx | 5 +++- .../src/popup/BalancePage.tsx | 5 +++- .../src/wallet/DeveloperPage.tsx | 29 ++++++++++++++++++++++ .../src/wallet/History.tsx | 23 +++++++++-------- 4 files changed, 50 insertions(+), 12 deletions(-) (limited to 'packages/taler-wallet-webextension') diff --git a/packages/taler-wallet-webextension/src/components/BalanceTable.tsx b/packages/taler-wallet-webextension/src/components/BalanceTable.tsx index d3733e6cc..b8bcaa391 100644 --- a/packages/taler-wallet-webextension/src/components/BalanceTable.tsx +++ b/packages/taler-wallet-webextension/src/components/BalanceTable.tsx @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ -import { Amounts, WalletBalance } from "@gnu-taler/taler-util"; +import { Amounts, ScopeType, WalletBalance } from "@gnu-taler/taler-util"; import { VNode, h } from "preact"; import { TableWithRoundRows as TableWithRoundedRows } from "./styled/index.js"; @@ -45,6 +45,9 @@ export function BalanceTable({ }} > {Amounts.stringifyValue(av, 2)} +
+ {entry.scopeInfo.type === ScopeType.Exchange || entry.scopeInfo.type === ScopeType.Auditor ? entry.scopeInfo.url : undefined} +
); diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx index 23614e290..513b37642 100644 --- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx +++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx @@ -153,7 +153,10 @@ export function BalanceView(state: State.Balances): VNode { const { i18n } = useTranslationContext(); const currencyWithNonZeroAmount = state.balances .filter((b) => !Amounts.isZero(b.available)) - .map((b) => b.available.split(":")[0]); + .map((b) => { + b.flags + return b.available.split(":")[0] + }); if (state.balances.length === 0) { return ( diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx index d12ae864b..5230d830f 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx @@ -170,6 +170,7 @@ export function View({ operations, coins, onDownloadDatabase }: Props): VNode { ); const [tagName, setTagName] = useState(""); + const [exchangeURL, setExchangeURL] = useState(""); const [logLevel, setLogLevel] = useState("info"); return (
@@ -397,6 +398,34 @@ export function View({ operations, coins, onDownloadDatabase }: Props): VNode { Set log level + +

Exchange

+
+ +
+ +
{ downloadedDatabase && (
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index dcc3c43e3..41b03424c 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -18,6 +18,7 @@ import { AbsoluteTime, Amounts, NotificationType, + ScopeType, Transaction, WalletBalance, } from "@gnu-taler/taler-util"; @@ -132,11 +133,10 @@ export function HistoryView({ (transactionByCurrency[av.currency] && transactionByCurrency[av.currency].length > 0) ); - }) - .map((b) => b.available.split(":")[0]); + }); const defaultCurrencyIndex = currencies.findIndex( - (c) => c === defaultCurrency, + (c) => c.scopeInfo.currency === defaultCurrency, ); const [currencyIndex, setCurrencyIndex] = useState( defaultCurrencyIndex === -1 ? 0 : defaultCurrencyIndex, @@ -151,7 +151,7 @@ export function HistoryView({ const ts = selectedCurrency === undefined ? [] - : transactionByCurrency[selectedCurrency] ?? []; + : transactionByCurrency[selectedCurrency.scopeInfo.currency] ?? []; const datesWithTransaction: string[] = []; const byDate = ts.reduce((rv, x) => { @@ -199,7 +199,7 @@ export function HistoryView({ {selectedCurrency} ) : ( - + +
+ {selectedCurrency.scopeInfo.type === ScopeType.Exchange || selectedCurrency.scopeInfo.type === ScopeType.Auditor ? selectedCurrency.scopeInfo.url : undefined} +
)} {currencyAmount && ( @@ -236,7 +239,7 @@ export function HistoryView({ tooltip="Transfer money to the wallet" startIcon={DownloadIcon} variant="contained" - onClick={() => goToWalletManualWithdraw(selectedCurrency)} + onClick={() => goToWalletManualWithdraw(selectedCurrency.scopeInfo.currency)} > Add @@ -246,7 +249,7 @@ export function HistoryView({ startIcon={UploadIcon} variant="outlined" color="primary" - onClick={() => goToWalletDeposit(selectedCurrency)} + onClick={() => goToWalletDeposit(selectedCurrency.scopeInfo.currency)} > Send -- cgit v1.2.3