diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet')
4 files changed, 17 insertions, 12 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx index 0bf271c5a..28caf9c22 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.stories.tsx @@ -19,9 +19,10 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { PendingTaskType } from "@gnu-taler/taler-wallet-core"; +import { PendingTaskType, TaskId } from "@gnu-taler/taler-wallet-core"; import * as tests from "@gnu-taler/web-util/testing"; import { View as TestedComponent } from "./DeveloperPage.js"; +import { PendingIdStr } from "@gnu-taler/taler-util"; export default { title: "developer", @@ -35,7 +36,7 @@ export const AllOff = tests.createExample(TestedComponent, { onDownloadDatabase: async () => "this is the content of the database", operations: [ { - id: "", + id: " " as TaskId, type: PendingTaskType.ExchangeUpdate, exchangeBaseUrl: "http://exchange.url.", givesLifeness: false, diff --git a/packages/taler-wallet-webextension/src/wallet/Notifications/stories.tsx b/packages/taler-wallet-webextension/src/wallet/Notifications/stories.tsx index 49ee21268..54f601c42 100644 --- a/packages/taler-wallet-webextension/src/wallet/Notifications/stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Notifications/stories.tsx @@ -19,7 +19,11 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { AbsoluteTime, AttentionType } from "@gnu-taler/taler-util"; +import { + AbsoluteTime, + AttentionType, + TransactionIdStr, +} from "@gnu-taler/taler-util"; import * as tests from "@gnu-taler/web-util/testing"; import { ReadyView } from "./views.js"; @@ -34,7 +38,7 @@ export const Ready = tests.createExample(ReadyView, { read: false, info: { type: AttentionType.KycWithdrawal, - transactionId: "123", + transactionId: "123" as TransactionIdStr, }, }, { @@ -42,7 +46,7 @@ export const Ready = tests.createExample(ReadyView, { read: false, info: { type: AttentionType.MerchantRefund, - transactionId: "123", + transactionId: "123" as TransactionIdStr, }, }, { diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx index 7f2069fc9..b2a8de014 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx @@ -26,6 +26,7 @@ import { TalerProtocolTimestamp, TransactionCommon, TransactionDeposit, + TransactionIdStr, TransactionMajorState, TransactionPayment, TransactionPeerPullCredit, @@ -63,7 +64,7 @@ const commonTransaction: TransactionCommon = { major: TransactionMajorState.Done, }, timestamp: TalerProtocolTimestamp.now(), - transactionId: "txn:deposit:12", + transactionId: "txn:deposit:12" as TransactionIdStr, type: TransactionType.Deposit, } as Omit< Omit<Omit<TransactionCommon, "extendedStatus">, "frozen">, diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index 938d62490..39b070e46 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -28,6 +28,7 @@ import { TalerProtocolTimestamp, Transaction, TransactionDeposit, + TransactionIdStr, TransactionMajorState, TransactionType, TranslatedString, @@ -74,10 +75,8 @@ interface Props { goToWalletHistory: (currency?: string) => Promise<void>; } -export function TransactionPage({ - tid: transactionId, - goToWalletHistory, -}: Props): VNode { +export function TransactionPage({ tid, goToWalletHistory }: Props): VNode { + const transactionId = tid as TransactionIdStr; //FIXME: validate const { i18n } = useTranslationContext(); const api = useBackendContext(); const state = useAsyncAsHook( @@ -152,7 +151,7 @@ export interface WalletTransactionProps { onCancel: () => Promise<void>; onDelete: () => Promise<void>; onRetry: () => Promise<void>; - onRefund: (id: string) => Promise<void>; + onRefund: (id: TransactionIdStr) => Promise<void>; onBack: () => Promise<void>; } @@ -621,7 +620,7 @@ export function TransactionView({ <Button variant="contained" onClick={safely("refund transaction", () => - onRefund(transaction.proposalId), + onRefund(transaction.transactionId), )} > <i18n.Translate>Accept</i18n.Translate> |