feat(ProfileShowcase): Sort and filter collectibles based on token management settings

This commit is contained in:
Alex Jbanca 2024-04-17 11:02:02 +03:00 committed by Alex Jbanca
parent e251d5907d
commit a045ca36fe
2 changed files with 25 additions and 1 deletions

View File

@ -227,6 +227,7 @@ void ManageTokensController::savingFinished()
incRevision(); incRevision();
setSettingsDirty(false); setSettingsDirty(false);
requestLoadSettings();
} }
void ManageTokensController::loadingStarted() void ManageTokensController::loadingStarted()

View File

@ -20,12 +20,15 @@ import "popups"
import "views" import "views"
import "views/profile" import "views/profile"
import StatusQ 0.1
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Layout 0.1 import StatusQ.Layout 0.1
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import StatusQ.Popups.Dialog 0.1 import StatusQ.Popups.Dialog 0.1
import StatusQ.Core.Utils 0.1 as SQUtils import StatusQ.Core.Utils 0.1 as SQUtils
import SortFilterProxyModel 0.2
StatusSectionLayout { StatusSectionLayout {
id: root id: root
@ -148,8 +151,28 @@ StatusSectionLayout {
communitiesShowcaseModel: root.store.ownShowcaseCommunitiesModel communitiesShowcaseModel: root.store.ownShowcaseCommunitiesModel
accountsShowcaseModel: root.store.ownShowcaseAccountsModel accountsShowcaseModel: root.store.ownShowcaseAccountsModel
collectiblesShowcaseModel: root.store.ownShowcaseCollectiblesModel
socialLinksShowcaseModel: root.store.ownShowcaseSocialLinksModel socialLinksShowcaseModel: root.store.ownShowcaseSocialLinksModel
collectiblesShowcaseModel: SortFilterProxyModel {
sourceModel: root.store.ownShowcaseCollectiblesModel
sorters: [
FastExpressionSorter {
expression: {
root.collectiblesStore.collectiblesController.revision
return root.collectiblesStore.collectiblesController.compareTokens(modelLeft.uid, modelRight.uid)
}
expectedRoles: ["uid"]
}
]
filters: [
FastExpressionFilter {
expression: {
root.collectiblesStore.collectiblesController.revision
return root.collectiblesStore.collectiblesController.filterAcceptsSymbol(model.uid)
}
expectedRoles: ["uid"]
}
]
}
assetsModel: root.globalStore.globalAssetsModel assetsModel: root.globalStore.globalAssetsModel
collectiblesModel: root.globalStore.globalCollectiblesModel collectiblesModel: root.globalStore.globalCollectiblesModel