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

in the end it turns out the Loader causes more problems (and even
crashes in some scenarios)
This commit is contained in:
Lukáš Tinkl 2023-12-15 14:23:52 +01:00 committed by Lukáš Tinkl
parent fe3b442155
commit b58612f070
2 changed files with 57 additions and 68 deletions

View File

@ -31,8 +31,7 @@ Item {
function resetView() {
stack.currentIndex = 0
root.currentTabIndex = 0
if (walletTabBar.currentIndex === 2)
mainViewLoader.item.resetView()
historyView.resetView()
}
function resetStack() {
@ -129,21 +128,12 @@ Item {
highlighted: checked
}
}
Loader {
StackLayout {
id: mainViewLoader
Layout.fillWidth: true
Layout.fillHeight: true
sourceComponent: {
switch (walletTabBar.currentIndex) {
case 0: return assetsView
case 1: return collectiblesView
case 2: return historyView
}
}
active: visible
currentIndex: walletTabBar.currentIndex
Component {
id: assetsView
AssetsView {
assets: RootStore.assets
overview: RootStore.overview
@ -167,9 +157,7 @@ Item {
onManageTokensRequested: Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.wallet,
Constants.walletSettingsSubsection.manageAssets)
}
}
Component {
id: collectiblesView
CollectiblesView {
collectiblesModel: RootStore.collectiblesStore.ownedCollectibles
sendEnabled: root.networkConnectionStore.sendBuyBridgeEnabled && !RootStore.overview.isWatchOnlyAccount && RootStore.overview.canSend
@ -191,10 +179,9 @@ Item {
onManageTokensRequested: Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.wallet,
Constants.walletSettingsSubsection.manageCollectibles)
}
}
Component {
id: historyView
HistoryView {
id: historyView
overview: RootStore.overview
showAllAccounts: root.showAllAccounts
sendModal: root.sendModal
@ -206,7 +193,6 @@ Item {
}
}
}
}
CollectibleDetailView {
collectible: RootStore.collectiblesStore.detailedCollectible
isCollectibleLoading: RootStore.collectiblesStore.isDetailedCollectibleLoading

View File

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