Skip to content

Commit

Permalink
Fix brave/brave-ios#8462: Custom Networks list not updated when opene…
Browse files Browse the repository at this point in the history
…d via browser settings (brave/brave-ios#8464)

Update chain list when custom networks list is opened to handle case when opened via browser settings.
  • Loading branch information
StephenHeaps committed Nov 27, 2023
1 parent 1df4c0e commit 1130eee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/BraveWallet/Crypto/Stores/NetworkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class NetworkStore: ObservableObject, WalletObserverStore {
self.isSwapSupported = await swapService.isSwapSupported(chain.chainId)
}

@MainActor private func updateChainList() async {
@MainActor func updateChainList() async {
// fetch all networks for all coin types
self.allChains = await rpcService.allNetworksForSupportedCoins(respectTestnetPreference: false)

Expand Down
3 changes: 3 additions & 0 deletions Sources/BraveWallet/Settings/CustomNetworkListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ struct CustomNetworkListView: View {
}
.navigationViewStyle(StackNavigationViewStyle())
}
.task {
await networkStore.updateChainList()
}
}
}

Expand Down

0 comments on commit 1130eee

Please sign in to comment.