fix(EditOwnerTokenView): Fee errors handling fixed

Closes: #11823
This commit is contained in:
Michał Cieślak 2023-08-11 14:16:53 +02:00 committed by Michał
parent 2c50004275
commit 197c211fbc
2 changed files with 56 additions and 37 deletions

View File

@ -247,7 +247,6 @@ StackView {
ownerToken.accountAddress, ownerToken.accountAddress,
Constants.TokenType.ERC721) Constants.TokenType.ERC721)
feeText: root.feeText feeText: root.feeText
feeErrorText: root.feeErrorText feeErrorText: root.feeErrorText
isFeeLoading: root.isFeeLoading isFeeLoading: root.isFeeLoading
@ -259,6 +258,7 @@ StackView {
editOwnerTokenView.communityName) editOwnerTokenView.communityName)
totalFeeText: root.isFeeLoading ? totalFeeText: root.isFeeLoading ?
"" : root.feeText "" : root.feeText
errorText: root.feeErrorText
accountName: editOwnerTokenView.ownerToken.accountName accountName: editOwnerTokenView.ownerToken.accountName
model: QtObject { model: QtObject {

View File

@ -1,19 +1,18 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Layouts 1.14 import QtQuick.Layouts 1.14
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Core 0.1 import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1 import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Core.Utils 0.1 as SQUtils import StatusQ.Core.Utils 0.1 as SQUtils
import StatusQ.Popups 0.1 import StatusQ.Popups 0.1
import utils 1.0 import AppLayouts.Communities.controls 1.0
import AppLayouts.Communities.panels 1.0
import AppLayouts.Communities.helpers 1.0 import AppLayouts.Communities.helpers 1.0
import AppLayouts.Communities.panels 1.0
import AppLayouts.Wallet.controls 1.0 import AppLayouts.Wallet.controls 1.0
import utils 1.0
import SortFilterProxyModel 0.2 import SortFilterProxyModel 0.2
@ -150,8 +149,10 @@ StatusScrollView {
description: qsTr("This account will be where you receive your Owner token and will also be the account that pays the token minting gas fees.") description: qsTr("This account will be where you receive your Owner token and will also be the account that pays the token minting gas fees.")
} }
// TO BE REMOVED: It will be removed with the new fees panel ColumnLayout {
StatusEmojiAndColorComboBox { spacing: 11
AccountSelector {
id: accountBox id: accountBox
readonly property string address: { readonly property string address: {
@ -170,16 +171,12 @@ StatusScrollView {
currentIndex: (initIndex !== -1) ? initIndex : 0 currentIndex: (initIndex !== -1) ? initIndex : 0
model: root.accounts model: root.accounts
type: StatusComboBox.Type.Secondary
size: StatusComboBox.Size.Small
implicitHeight: 44
defaultAssetName: "filled-account"
onAddressChanged: { onAddressChanged: {
ownerToken.accountAddress = address ownerToken.accountAddress = address
tMasterToken.accountAddress = address tMasterToken.accountAddress = address
root.deployFeesRequested() requestFeeDelayTimer.restart()
} }
control.onDisplayTextChanged: { control.onDisplayTextChanged: {
ownerToken.accountName = control.displayText ownerToken.accountName = control.displayText
@ -187,6 +184,19 @@ StatusScrollView {
} }
} }
StatusBaseText {
Layout.fillWidth: true
visible: !!root.feeErrorText
horizontalAlignment: Text.AlignRight
font.pixelSize: Theme.tertiaryTextFontSize
color: Theme.palette.dangerColor1
text: root.feeErrorText
wrapMode: Text.Wrap
}
}
CustomNetworkFilterRowComponent { CustomNetworkFilterRowComponent {
id: networkSelector id: networkSelector
@ -240,6 +250,8 @@ StatusScrollView {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 4 Layout.topMargin: 4
Layout.bottomMargin: Style.current.padding Layout.bottomMargin: Style.current.padding
enabled: root.feeText && !root.feeErrorText
text: qsTr("Mint") text: qsTr("Mint")
onClicked: root.mintClicked() onClicked: root.mintClicked()
@ -313,8 +325,15 @@ StatusScrollView {
tMasterToken.chainName = network.chainName tMasterToken.chainName = network.chainName
tMasterToken.chainIcon = network.iconUrl tMasterToken.chainIcon = network.iconUrl
root.deployFeesRequested() requestFeeDelayTimer.restart()
} }
} }
} }
Timer {
id: requestFeeDelayTimer
interval: 500
onTriggered: root.deployFeesRequested()
}
} }