Skip to content

Commit

Permalink
[ABW-3779] Fix Home not showing resources after hiding Account (#1324)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbzurovski authored Sep 9, 2024
1 parent 1a5e1f2 commit 9534476
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion RadixWallet/Features/HomeFeature/Coordinator/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,13 @@ public struct Home: Sendable, FeatureReducer {
return .none
}

state.accountRows = accounts.map { Home.AccountRow.State(account: $0, problems: state.problems) }.asIdentified()
state.accountRows = accounts
.map { account in
// Create new Home.AccountRow.State only if it wasn't present before. Otherwise, we keep the old row
// which probably has already loaded its resources & fiat worth.
state.accountRows.first(where: { $0.id == account.address }) ?? .init(account: account, problems: state.problems)
}
.asIdentified()

return .run { [addresses = state.accountAddresses] _ in
_ = try await accountPortfoliosClient.fetchAccountPortfolios(addresses, false)
Expand Down

0 comments on commit 9534476

Please sign in to comment.