feat(MintToken): Disable airdrop, remote destruct and burn options if mint status is failed

Airdrop, remote destruct and burn options disabled if token status failed.
This commit is contained in:
Noelia 2023-06-12 12:25:59 +02:00 committed by Noelia
parent 5e4164e2e6
commit 9524ced598
3 changed files with 15 additions and 9 deletions

View File

@ -55,7 +55,7 @@ QtObject {
tokenType: 2, tokenType: 2,
name: "Kitty artwork", name: "Kitty artwork",
image: ModelsData.collectibles.kitty1Big, image: ModelsData.collectibles.kitty1Big,
deployState: 2, deployState: 0,
symbol: "KAT", symbol: "KAT",
description: "Desc", description: "Desc",
supply: 10, supply: 10,

View File

@ -83,7 +83,7 @@ SettingsPageLayout {
property var tokenOwnersModel property var tokenOwnersModel
property var remotelyDestructTokensList property var remotelyDestructTokensList
property bool remotelyDestruct property bool remotelyDestruct
property bool burnEnabled property bool burnVisible
property string tokenKey property string tokenKey
property int burnAmount property int burnAmount
property int remainingTokens property int remainingTokens
@ -397,16 +397,20 @@ SettingsPageLayout {
MintTokensFooterPanel { MintTokensFooterPanel {
id: footerPanel id: footerPanel
readonly property bool deployStateFailed : (!!d.currentToken) ? d.currentToken.deployState === Constants.ContractTransactionStatus.Failed : false
function closePopups() { function closePopups() {
remotelyDestructPopup.close() remotelyDestructPopup.close()
alertPopup.close() alertPopup.close()
signTransactionPopup.close() signTransactionPopup.close()
} }
airdropEnabled: true airdropEnabled: !deployStateFailed
retailEnabled: false remotelyDestructEnabled: !deployStateFailed
remotelySelfDestructVisible: d.remotelyDestruct burnEnabled: !deployStateFailed
burnVisible: d.burnEnabled
remotelyDestructVisible: d.remotelyDestruct
burnVisible: d.burnVisible
onAirdropClicked: d.airdropClicked() onAirdropClicked: d.airdropClicked()
onRemotelyDestructClicked: remotelyDestructPopup.open() onRemotelyDestructClicked: remotelyDestructPopup.open()
@ -589,7 +593,7 @@ SettingsPageLayout {
Binding { Binding {
target: d target: d
property: "burnEnabled" property: "burnVisible"
value: !view.infiniteSupply value: !view.infiniteSupply
restoreMode: Binding.RestoreBindingOrValue restoreMode: Binding.RestoreBindingOrValue
} }

View File

@ -13,7 +13,9 @@ Control {
property alias airdropEnabled: airdropButton.enabled property alias airdropEnabled: airdropButton.enabled
property alias retailEnabled: retailButton.enabled property alias retailEnabled: retailButton.enabled
property alias remotelySelfDestructVisible: remotelySelfDestructButton.visible property alias remotelyDestructEnabled: remotelyDestructButton.enabled
property alias burnEnabled: burnButton.enabled
property alias remotelyDestructVisible: remotelyDestructButton.visible
property alias burnVisible: burnButton.visible property alias burnVisible: burnButton.visible
signal airdropClicked signal airdropClicked
@ -55,7 +57,7 @@ Control {
} }
StatusFlatButton { StatusFlatButton {
id: remotelySelfDestructButton id: remotelyDestructButton
icon.name: "remotely-destruct" icon.name: "remotely-destruct"
text: qsTr("Remotely destruct") text: qsTr("Remotely destruct")