fix: Burn and self destruct pop-ups are not closed after signing

- close the first popup before opening another
- fix `SignTokenTransactionsPopup` title (it would display "Burn
undefined tokens")
- remove duplicate close() calls
- `destroyOnClose: false` is the default

Fixes #11498
This commit is contained in:
Lukáš Tinkl 2023-07-21 14:10:37 +02:00 committed by Lukáš Tinkl
parent e744c847ad
commit ef2d1b75ad
1 changed files with 4 additions and 7 deletions

View File

@ -476,9 +476,9 @@ StackView {
collectibleName: view.token.name collectibleName: view.token.name
model: view.tokenOwnersModel || null model: view.tokenOwnersModel || null
destroyOnClose: false
onRemotelyDestructClicked: { onRemotelyDestructClicked: {
remotelyDestructPopup.close()
footer.remotelyDestructTokensList = remotelyDestructTokensList footer.remotelyDestructTokensList = remotelyDestructTokensList
alertPopup.tokenCount = tokenCount alertPopup.tokenCount = tokenCount
alertPopup.open() alertPopup.open()
@ -490,8 +490,6 @@ StackView {
property int tokenCount property int tokenCount
destroyOnClose: false
title: qsTr("Remotely destruct %n token(s)", "", tokenCount) title: qsTr("Remotely destruct %n token(s)", "", tokenCount)
acceptBtnText: qsTr("Remotely destruct") acceptBtnText: qsTr("Remotely destruct")
alertText: qsTr("Continuing will destroy tokens held by members and revoke any permissions they are given. To undo you will have to issue them new tokens.") alertText: qsTr("Continuing will destroy tokens held by members and revoke any permissions they are given. To undo you will have to issue them new tokens.")
@ -521,8 +519,8 @@ StackView {
} }
title: signTransactionPopup.isRemotelyDestructTransaction title: signTransactionPopup.isRemotelyDestructTransaction
? qsTr("Sign transaction - Self-destruct %1 tokens").arg(root.title) ? qsTr("Sign transaction - Self-destruct %1 tokens").arg(tokenName)
: qsTr("Sign transaction - Burn %1 tokens").arg(root.title) : qsTr("Sign transaction - Burn %1 tokens").arg(tokenName)
tokenName: footer.token.name tokenName: footer.token.name
accountName: footer.token.accountName accountName: footer.token.accountName
@ -537,7 +535,6 @@ StackView {
? root.signRemoteDestructTransactionOpened(footer.remotelyDestructTokensList, tokenKey) ? root.signRemoteDestructTransactionOpened(footer.remotelyDestructTokensList, tokenKey)
: root.signBurnTransactionOpened(tokenKey, footer.burnAmount) : root.signBurnTransactionOpened(tokenKey, footer.burnAmount)
} }
onCancelClicked: close()
onSignTransactionClicked: signTransaction() onSignTransactionClicked: signTransaction()
} }
@ -550,6 +547,7 @@ StackView {
tokenSource: footer.token.artworkSource tokenSource: footer.token.artworkSource
onBurnClicked: { onBurnClicked: {
burnTokensPopup.close()
footer.burnAmount = burnAmount footer.burnAmount = burnAmount
signTransactionPopup.isRemotelyDestructTransaction = false signTransactionPopup.isRemotelyDestructTransaction = false
signTransactionPopup.open() signTransactionPopup.open()
@ -571,7 +569,6 @@ StackView {
root.deleteToken(tokenViewPage.token.key) root.deleteToken(tokenViewPage.token.key)
root.navigateBack() root.navigateBack()
} }
onCancelClicked: close()
} }
} }