diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/AccountPage/state.ts')
-rw-r--r-- | packages/demobank-ui/src/pages/AccountPage/state.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/packages/demobank-ui/src/pages/AccountPage/state.ts b/packages/demobank-ui/src/pages/AccountPage/state.ts index 1a1475c0d..b12afbf9e 100644 --- a/packages/demobank-ui/src/pages/AccountPage/state.ts +++ b/packages/demobank-ui/src/pages/AccountPage/state.ts @@ -40,7 +40,7 @@ export function useComponentState({ account, goToBusinessAccount, goToConfirmOpe }; } //logout if there is any error, not if loading - backend.logOut(); + // backend.logOut(); if (result.status === HttpStatusCode.NotFound) { notifyError(i18n.str`Username or account label "${account}" not found`, undefined); return { @@ -55,9 +55,13 @@ export function useComponentState({ account, goToBusinessAccount, goToConfirmOpe } const { data } = result; - const balance = Amounts.parseOrThrow(data.balance.amount); - const debitThreshold = Amounts.parseOrThrow(data.debitThreshold); - const payto = parsePaytoUri(data.paytoUri); + + // FIXME: balance + // const balance = Amounts.parseOrThrow(data.balance.amount); + const balance = Amounts.parseOrThrow(data.balance); + + const debitThreshold = Amounts.parseOrThrow(data.debit_threshold); + const payto = parsePaytoUri(data.payto_uri); if (!payto || !payto.isKnown || (payto.targetType !== "iban" && payto.targetType !== "x-taler-bank")) { return { @@ -66,7 +70,9 @@ export function useComponentState({ account, goToBusinessAccount, goToConfirmOpe }; } - const balanceIsDebit = data.balance.credit_debit_indicator == "debit"; + // FIXME: balance + const balanceIsDebit = true; + // data.balance.credit_debit_indicator == "debit"; const limit = balanceIsDebit ? Amounts.sub(debitThreshold, balance).amount : Amounts.add(balance, debitThreshold).amount; |