Skip to content

Commit

Permalink
Updates, show always filter only for wallet chains
Browse files Browse the repository at this point in the history
  • Loading branch information
gemdev111 committed Sep 12, 2024
1 parent a4e7751 commit 32089cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
27 changes: 12 additions & 15 deletions Gem/Assets/Navigation/SelectAssetSceneNavigationStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,20 @@ struct SelectAssetSceneNavigationStack: View {
.accessibilityIdentifier("cancel")
}
if model.showAddToken {

if model.showFiltering {
ToolbarItem(placement: .navigationBarTrailing) {
Button {
isPresentingFilteringView = true
} label: {
if model.filterModel.isCusomFilteringSpecified {
Image(systemName: SystemImage.filterFill)
.symbolRenderingMode(.palette)
.foregroundStyle(Colors.whiteSolid, Colors.blue)
} else {
Image(systemName: SystemImage.filter)
.foregroundStyle(.primary)
}
ToolbarItem(placement: .navigationBarTrailing) {
Button {
isPresentingFilteringView = true
} label: {
if model.filterModel.isCusomFilteringSpecified {
Image(systemName: SystemImage.filterFill)
.symbolRenderingMode(.palette)
.foregroundStyle(Colors.whiteSolid, Colors.blue)
} else {
Image(systemName: SystemImage.filter)
.foregroundStyle(.primary)
}
.contentTransition(.symbolEffect(.replace))
}
.contentTransition(.symbolEffect(.replace))
}

ToolbarItem(placement: .navigationBarTrailing) {
Expand Down
4 changes: 3 additions & 1 deletion Gem/Assets/ViewModels/AssetsFilterViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Settings

struct AssetsFilterViewModel {
private let type: SelectAssetType
let allChains: [Chain] = AssetConfiguration.allChains

let allChains: [Chain]

var assetsRequest: AssetsRequest

Expand All @@ -25,6 +26,7 @@ struct AssetsFilterViewModel {
}

init(wallet: Wallet, type: SelectAssetType) {
self.allChains = WalletSupportedChains(wallet: wallet).sortedByRank
self.assetsRequest = AssetsRequest(
walletID: wallet.id,
filters: Self.defaultFilters(type: type)
Expand Down
4 changes: 0 additions & 4 deletions Gem/Assets/ViewModels/SelectAssetViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ class SelectAssetViewModel {
var showAddToken: Bool {
selectType == .manage && !walletChains.isEmpty
}

var showFiltering: Bool {
selectType == .manage && walletChains.hasMany
}
}

// MARK: - Business Logic
Expand Down

0 comments on commit 32089cb

Please sign in to comment.