diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-05 14:59:02 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-05 14:59:02 -0300 |
commit | f68585db5f9ba0f760e22dada474fd7ec2847796 (patch) | |
tree | b1efaf9560df032225f7aa1debdb4e8624261b92 /packages/demobank-ui/src/components/Transactions/state.ts | |
parent | 58d45fc8aef174027b2855a3cd24b0eb73d6de2e (diff) | |
download | wallet-core-f68585db5f9ba0f760e22dada474fd7ec2847796.tar.xz |
pretty
Diffstat (limited to 'packages/demobank-ui/src/components/Transactions/state.ts')
-rw-r--r-- | packages/demobank-ui/src/components/Transactions/state.ts | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/packages/demobank-ui/src/components/Transactions/state.ts b/packages/demobank-ui/src/components/Transactions/state.ts index 4109c88b2..74e6b0d36 100644 --- a/packages/demobank-ui/src/components/Transactions/state.ts +++ b/packages/demobank-ui/src/components/Transactions/state.ts @@ -42,34 +42,34 @@ export function useComponentState({ account }: Props): State { result.data.type === "fail" ? [] : result.data.body.transactions - .map((tx) => { - const negative = tx.direction === "debit"; - const cp = parsePaytoUri( - negative ? tx.creditor_payto_uri : tx.debtor_payto_uri, - ); - const counterpart = - (cp === undefined || !cp.isKnown - ? undefined - : cp.targetType === "iban" - ? cp.iban - : cp.targetType === "x-taler-bank" - ? cp.account - : cp.targetType === "bitcoin" - ? `${cp.targetPath.substring(0, 6)}...` - : undefined) ?? "unknown"; + .map((tx) => { + const negative = tx.direction === "debit"; + const cp = parsePaytoUri( + negative ? tx.creditor_payto_uri : tx.debtor_payto_uri, + ); + const counterpart = + (cp === undefined || !cp.isKnown + ? undefined + : cp.targetType === "iban" + ? cp.iban + : cp.targetType === "x-taler-bank" + ? cp.account + : cp.targetType === "bitcoin" + ? `${cp.targetPath.substring(0, 6)}...` + : undefined) ?? "unknown"; - const when = AbsoluteTime.fromProtocolTimestamp(tx.date); - const amount = Amounts.parse(tx.amount); - const subject = tx.subject; - return { - negative, - counterpart, - when, - amount, - subject, - }; - }) - .filter((x): x is Transaction => x !== undefined); + const when = AbsoluteTime.fromProtocolTimestamp(tx.date); + const amount = Amounts.parse(tx.amount); + const subject = tx.subject; + return { + negative, + counterpart, + when, + amount, + subject, + }; + }) + .filter((x): x is Transaction => x !== undefined); return { status: "ready", |