From 44ebf6fca59a9da20023388be7f4ba2443d1b6b6 Mon Sep 17 00:00:00 2001 From: Felix Brucker Date: Sat, 11 Nov 2023 22:45:28 +0530 Subject: [PATCH] Fix crash on missing wallets --- src/app/api/types/satellite.ts | 2 +- src/app/wallet-summary/wallet-summary.component.ts | 2 +- src/app/wallet/wallet.component.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/api/types/satellite.ts b/src/app/api/types/satellite.ts index ab0d873..e907609 100644 --- a/src/app/api/types/satellite.ts +++ b/src/app/api/types/satellite.ts @@ -65,7 +65,7 @@ export interface WalletSyncStatus { } export interface WalletStats { - wallets: Wallet[] + wallets?: Wallet[] syncStatus: WalletSyncStatus farmedAmount: { lastHeightFarmed: number diff --git a/src/app/wallet-summary/wallet-summary.component.ts b/src/app/wallet-summary/wallet-summary.component.ts index 7d22208..6f353fc 100644 --- a/src/app/wallet-summary/wallet-summary.component.ts +++ b/src/app/wallet-summary/wallet-summary.component.ts @@ -28,7 +28,7 @@ export class WalletSummaryComponent implements OnInit { const disabledWallets = this.getDisabledWalletsForFingerprint(curr.fingerprint) return acc.concat( - curr.wallets.filter(wallet => + (curr.wallets ?? []).filter(wallet => isChiaWallet(wallet.type) && disabledWallets.every(disabledWallet => disabledWallet.id !== wallet.id) ) diff --git a/src/app/wallet/wallet.component.ts b/src/app/wallet/wallet.component.ts index 4d6225c..73cc2de 100644 --- a/src/app/wallet/wallet.component.ts +++ b/src/app/wallet/wallet.component.ts @@ -71,7 +71,7 @@ export class WalletComponent implements OnInit { public get wallets(): WalletInfo[] { const disabledWallets = this.disabledWallets - return this.wallet.wallets + return (this.wallet.wallets ?? []) .filter(wallet => disabledWallets.every(disabledWallet => disabledWallet.id !== wallet.id)) .map(wallet => { return {