mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-22 20:40:18 +00:00
fix(MintToken): Initial item updated according to tokenModel
changes
Updated stackview with the corresponding initial item when `tokenModel` changes.
This commit is contained in:
parent
3db1ce70d1
commit
6752d274e1
@ -71,6 +71,16 @@ SettingsPageLayout {
|
|||||||
property bool preview: false
|
property bool preview: false
|
||||||
property string accountAddress
|
property string accountAddress
|
||||||
readonly property var initialItem: (root.tokensModel && root.tokensModel.count > 0) ? mintedTokensView : welcomeView
|
readonly property var initialItem: (root.tokensModel && root.tokensModel.count > 0) ? mintedTokensView : welcomeView
|
||||||
|
onInitialItemChanged: updateInitialStackView()
|
||||||
|
|
||||||
|
function updateInitialStackView() {
|
||||||
|
if(stackManager.stackView) {
|
||||||
|
if(initialItem === welcomeView)
|
||||||
|
stackManager.stackView.replace(mintedTokensView, welcomeView, StackView.Immediate)
|
||||||
|
if(initialItem === mintedTokensView)
|
||||||
|
stackManager.stackView.replace(welcomeView, mintedTokensView, StackView.Immediate)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
content: StackView {
|
content: StackView {
|
||||||
@ -114,11 +124,6 @@ SettingsPageLayout {
|
|||||||
]
|
]
|
||||||
|
|
||||||
onHeaderButtonClicked: stackManager.push(d.newCollectibleViewState, newCollectiblesView, null, StackView.Immediate)
|
onHeaderButtonClicked: stackManager.push(d.newCollectibleViewState, newCollectiblesView, null, StackView.Immediate)
|
||||||
onTokensModelChanged: {
|
|
||||||
if(root.tokensModel && root.tokensModel.count === 1) {
|
|
||||||
stackManager.stackView.replace(welcomeView, d.initialItem, StackView.Immediate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StackViewStates {
|
StackViewStates {
|
||||||
id: stackManager
|
id: stackManager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user