Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
do not wait for balance fetching to render migrated user assets
Browse files Browse the repository at this point in the history
  • Loading branch information
nuo-xu committed Feb 8, 2024
1 parent bac1398 commit fb0aabc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Sources/BraveWallet/WalletUserAssetManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,8 @@ public class WalletUserAssetManager: WalletUserAssetManagerType, WalletObserverS
migrateUserAssets(for: Array(WalletConstants.supportedCoinTypes()), completion: { [weak self] in
// new wallet created or new wallet restored. finished user asset migration
// so we want to fetch user assets balances and cache them
self?.refreshBalances {
completion?()
}
self?.refreshBalances()
completion?()
})
} else {
let allNetworks = await rpcService.allNetworksForSupportedCoins(respectTestnetPreference: false)
Expand All @@ -265,9 +264,8 @@ public class WalletUserAssetManager: WalletUserAssetManagerType, WalletObserverS
// new coin type introduced, so we want to fetch user assets balances and cache them after
// new coin type assets have been migrated to CD
self.migrateUserAssets(for: newCoins, completion: { [weak self] in
self?.refreshBalances {
completion?()
}
self?.refreshBalances()
completion?()
})
} else {
// no migration happens. refreshing user assets balance will happen after unlock
Expand Down

0 comments on commit fb0aabc

Please sign in to comment.