Revert "fix(RightTabView): revert to using a StackLayout instead of a Loader"

This reverts commit b58612f070.
This commit is contained in:
Alex Jbanca 2024-01-25 11:18:58 +00:00 committed by Alex Jbanca
parent 0fbb2ebcb5
commit a6abdbeeef
2 changed files with 77 additions and 64 deletions

View File

@ -30,7 +30,8 @@ RightTabBaseView {
function resetView() {
stack.currentIndex = 0
root.currentTabIndex = 0
historyView.resetView()
if (walletTabBar.currentIndex === 2)
mainViewLoader.item.resetView()
}
function resetStack() {
@ -119,12 +120,21 @@ RightTabBaseView {
highlighted: checked
}
}
StackLayout {
Loader {
id: mainViewLoader
Layout.fillWidth: true
Layout.fillHeight: true
currentIndex: walletTabBar.currentIndex
sourceComponent: {
switch (walletTabBar.currentIndex) {
case 0: return assetsView
case 1: return collectiblesView
case 2: return historyView
}
}
active: visible
Component {
id: assetsView
AssetsView {
areAssetsLoading: RootStore.overview.balanceLoading
assets: RootStore.walletAssetsStore.groupedAccountAssetsModel
@ -152,7 +162,9 @@ RightTabBaseView {
onManageTokensRequested: Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.wallet,
Constants.walletSettingsSubsection.manageAssets)
}
}
Component {
id: collectiblesView
CollectiblesView {
collectiblesModel: RootStore.collectiblesStore.allCollectiblesModel
networkFilters: RootStore.networkFilters
@ -176,7 +188,9 @@ RightTabBaseView {
onManageTokensRequested: Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.wallet,
Constants.walletSettingsSubsection.manageCollectibles)
}
}
Component {
id: historyView
HistoryView {
id: historyView
overview: RootStore.overview
@ -191,6 +205,7 @@ RightTabBaseView {
}
}
}
}
CollectibleDetailView {
collectible: RootStore.collectiblesStore.detailedCollectible
isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading

View File

@ -40,10 +40,8 @@ ColumnLayout {
}
}
onVisibleChanged: {
if (!visible)
return
Component.onCompleted: {
filterPanelLoader.active = true
if (RootStore.transactionActivityStatus.isFilterDirty) {
WalletStores.RootStore.currentActivityFiltersStore.applyAllFilters()
}