fix(MintToken): Footer options must be disabled in some cases

- Footer options must be disabled until minting process is completed.

- Airdrop footer option must be disabled if not available tokens to airdrop.

- Remotely destruct footer option must be disabled if no hodlers.

Fixes #11198
This commit is contained in:
Noelia 2023-06-21 18:41:13 +02:00 committed by Noelia
parent 6edfa002d2
commit 9b5efd59ef
1 changed files with 8 additions and 8 deletions

View File

@ -94,7 +94,7 @@ SettingsPageLayout {
property var tokenOwnersModel
property var remotelyDestructTokensList
property bool remotelyDestruct
property bool burnVisible
property bool infiniteSupply
property string tokenKey
property int burnAmount
property int remainingTokens
@ -413,7 +413,7 @@ SettingsPageLayout {
MintTokensFooterPanel {
id: footerPanel
readonly property bool deployStateFailed : (!!d.currentToken) ? d.currentToken.deployState === Constants.ContractTransactionStatus.Failed : false
readonly property bool deployStateCompleted : (!!d.currentToken) ? d.currentToken.deployState === Constants.ContractTransactionStatus.Completed : false
function closePopups() {
remotelyDestructPopup.close()
@ -422,12 +422,12 @@ SettingsPageLayout {
burnTokensPopup.close()
}
airdropEnabled: !deployStateFailed
remotelyDestructEnabled: !deployStateFailed
burnEnabled: !deployStateFailed
airdropEnabled: deployStateCompleted && (d.infiniteSupply || d.remainingTokens != 0)
remotelyDestructEnabled: deployStateCompleted && (d.tokenOwnersModel && d.tokenOwnersModel.count > 0)
burnEnabled: deployStateCompleted
remotelyDestructVisible: d.remotelyDestruct
burnVisible: d.burnVisible
burnVisible: !d.infiniteSupply
onAirdropClicked: d.airdropClicked()
onRemotelyDestructClicked: remotelyDestructPopup.open()
@ -610,8 +610,8 @@ SettingsPageLayout {
Binding {
target: d
property: "burnVisible"
value: !view.infiniteSupply
property: "infiniteSupply"
value: view.infiniteSupply
restoreMode: Binding.RestoreBindingOrValue
}