diff --git a/frontends/web/src/routes/account/summary/accountssummary.tsx b/frontends/web/src/routes/account/summary/accountssummary.tsx index 079bed7ff6..23079b5972 100644 --- a/frontends/web/src/routes/account/summary/accountssummary.tsx +++ b/frontends/web/src/routes/account/summary/accountssummary.tsx @@ -27,6 +27,7 @@ import { FiatConversion } from '../../../components/rates/rates'; import { Check } from '../../../components/icon/icon'; import Logo from '../../../components/icon/logo'; import Spinner from '../../../components/spinner/ascii'; +import { Spinner as ErrorSpinner } from '../../../components/spinner/Spinner'; import { debug } from '../../../utils/env'; import { Chart } from './chart'; import { AddBuyOnEmptyBalances } from '../info/buyCTA'; @@ -52,6 +53,7 @@ interface State { exported: string; balances?: Balances; syncStatus?: SyncStatus; + offlineErrors: string[]; totalBalancePerCoin?: accountApi.ITotalBalance; } @@ -75,6 +77,7 @@ class AccountsSummary extends Component { public readonly state: State = { data: undefined, exported: '', + offlineErrors: [], totalBalancePerCoin: undefined, }; private unsubscribe!: () => void; @@ -165,6 +168,10 @@ class AccountsSummary extends Component { private async onStatusChanged(code: string, initial: boolean = false) { const status = await accountApi.getStatus(code); + const { offlineErrors } = this.state; + if (status.offlineError && !offlineErrors.includes(status.offlineError)) { + this.setState({ offlineErrors: [...offlineErrors, status.offlineError] }); + } if (status.disabled) { return; } @@ -296,7 +303,7 @@ class AccountsSummary extends Component { public render() { const { t, accounts } = this.props; - const { exported, data, balances } = this.state; + const { exported, data, balances, offlineErrors } = this.state; return (
@@ -322,60 +329,66 @@ class AccountsSummary extends Component { )}
- - ) : undefined - } /> -
- - - - - - - - - - - - - - - { accounts.length > 0 ? ( - this.renderAccountSummary() - ) : ( - - - - )} - - - - - - - -
{t('accountSummary.name')}{t('accountSummary.balance')}{t('accountSummary.fiatBalance')}
- {t('accountSummary.noAccount')} -
- {t('accountSummary.total')} - - {(data && data.formattedChartTotal !== null) ? ( - <> - - {data.formattedChartTotal} - - {' '} - - {data.chartFiat} - - - ) : () } -
-
+ {offlineErrors.length ? ( + + ) : ( + <> + + ) : undefined + } /> +
+ + + + + + + + + + + + + + + { accounts.length > 0 ? ( + this.renderAccountSummary() + ) : ( + + + + )} + + + + + + + +
{t('accountSummary.name')}{t('accountSummary.balance')}{t('accountSummary.fiatBalance')}
+ {t('accountSummary.noAccount')} +
+ {t('accountSummary.total')} + + {(data && data.formattedChartTotal !== null) ? ( + <> + + {data.formattedChartTotal} + + {' '} + + {data.chartFiat} + + + ) : () } +
+
+ + )}