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

Fix #8649: Improve Performance of Select Token to Send #8654

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ struct SendTokenView: View {
didAutoShowSelectAccountToken = true
}
sendTokenStore.update()
await sendTokenStore.selectTokenStore.update()
sendTokenStore.selectTokenStore.setup()
}
.navigationViewStyle(.stack)
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/BraveWallet/Crypto/SelectAccountTokenView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ struct SelectAccountTokenView: View {

var body: some View {
List {
if store.accountSections.isEmpty {
if !store.isSetup {
// Fetching accounts & assets. Typically won't see this.
ProgressView()
.listRowBackground(Color(.secondaryBraveGroupedBackground))
} else if store.filteredAccountSections.flatMap(\.tokenBalances).isEmpty && !store.isLoadingBalances {
} else if store.accountSections.isEmpty && !store.isLoadingBalances {
Text(Strings.Wallet.selectTokenToSendNoTokens)
.font(.headline.weight(.semibold))
.foregroundColor(Color(.braveLabel))
Expand Down Expand Up @@ -80,7 +80,7 @@ struct SelectAccountTokenView: View {
if !store.isHidingZeroBalances {
return true
}
return store.filteredAccountSections.flatMap(\.tokenBalances).isEmpty
return store.accountSections.isEmpty
}

private var networkFilterButton: some View {
Expand Down Expand Up @@ -110,7 +110,7 @@ struct SelectAccountTokenView: View {
}

private var accountSections: some View {
ForEach(store.filteredAccountSections) { accountSection in
ForEach(store.accountSections) { accountSection in
Section(
content: {
if accountSection.tokenBalances.isEmpty {
Expand Down
Loading