Skip to content

Commit

Permalink
Fix crash on missing wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Nov 11, 2023
1 parent 9077b29 commit 44ebf6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/api/types/satellite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface WalletSyncStatus {
}

export interface WalletStats {
wallets: Wallet[]
wallets?: Wallet[]
syncStatus: WalletSyncStatus
farmedAmount: {
lastHeightFarmed: number
Expand Down
2 changes: 1 addition & 1 deletion src/app/wallet-summary/wallet-summary.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down
2 changes: 1 addition & 1 deletion src/app/wallet/wallet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 44ebf6f

Please sign in to comment.