mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
9fcb54cb74
- unbreak passing the controller into the adaptor; can't be strongly typed as that hides all the assets (always returns `false` from the `visible` property) - fix selecting account address (var account -> string accountAddress) - fix the mocked account model to contain the needed `canSend` role, fix the mocked check function - fix showing community assets and balance threshold
67 lines
1.8 KiB
QML
67 lines
1.8 KiB
QML
import QtQuick 2.15
|
|
|
|
import StatusQ 0.1
|
|
|
|
import Storybook 1.0
|
|
import Models 1.0
|
|
|
|
QtObject {
|
|
id: root
|
|
|
|
property TokensStore walletTokensStore: TokensStore {}
|
|
|
|
readonly property var groupedAccountsAssetsModel: GroupedAccountsAssetsModel {}
|
|
property var assetsWithFilteredBalances
|
|
readonly property var tokensBySymbolModel: TokensBySymbolModel {}
|
|
readonly property var communityModel: ListModel {
|
|
Component.onCompleted: append([{
|
|
communityId: "ddls",
|
|
communityName: "Doodles",
|
|
communityImage: ModelsData.collectibles.doodles
|
|
},
|
|
{
|
|
communityId: "sox",
|
|
communityName: "Socks",
|
|
communityImage: ModelsData.icons.socks
|
|
},
|
|
{
|
|
communityId: "ast",
|
|
communityName: "Astafarians",
|
|
communityImage: ModelsData.icons.dribble
|
|
}])
|
|
}
|
|
|
|
// renaming tokens by symbol key so that can be used to join models
|
|
readonly property var renamedTokensBySymbolModel: RolesRenamingModel {
|
|
sourceModel: tokensBySymbolModel
|
|
mapping: [
|
|
RoleRename {
|
|
from: "key"
|
|
to: "tokensKey"
|
|
}
|
|
]
|
|
}
|
|
|
|
// join account assets and tokens by symbol model
|
|
property LeftJoinModel jointModel: LeftJoinModel {
|
|
leftModel: assetsWithFilteredBalances
|
|
rightModel: renamedTokensBySymbolModel
|
|
joinRole: "tokensKey"
|
|
}
|
|
|
|
// combining community model with assets to get community meta data
|
|
property LeftJoinModel groupedAccountAssetsModel: LeftJoinModel {
|
|
leftModel: jointModel
|
|
rightModel: communityModel
|
|
joinRole: "communityId"
|
|
}
|
|
|
|
readonly property var assetsController: QtObject {
|
|
property int revision
|
|
|
|
function filterAcceptsSymbol(symbol) {
|
|
return true
|
|
}
|
|
}
|
|
}
|