fix: update tx modal validity
This commit is contained in:
parent
2a59ab402d
commit
1fc0e26a0f
|
@ -29,7 +29,7 @@ ModalPopup {
|
||||||
anchors.rightMargin: Style.current.padding
|
anchors.rightMargin: Style.current.padding
|
||||||
onGroupActivated: {
|
onGroupActivated: {
|
||||||
root.title = group.headerText
|
root.title = group.headerText
|
||||||
btnNext.label = group.footerText
|
btnNext.text = group.footerText
|
||||||
}
|
}
|
||||||
TransactionFormGroup {
|
TransactionFormGroup {
|
||||||
id: group1
|
id: group1
|
||||||
|
@ -166,16 +166,15 @@ ModalPopup {
|
||||||
stack.back()
|
stack.back()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StyledButton {
|
StatusButton {
|
||||||
id: btnNext
|
id: btnNext
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
//% "Next"
|
//% "Next"
|
||||||
label: qsTrId("next")
|
text: qsTrId("next")
|
||||||
disabled: !stack.currentGroup.isValid
|
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const isValid = stack.currentGroup.validate()
|
const validity = stack.currentGroup.validate()
|
||||||
|
if (validity.isValid && !validity.isPending) {
|
||||||
if (stack.currentGroup.validate()) {
|
|
||||||
if (stack.isLastGroup) {
|
if (stack.isLastGroup) {
|
||||||
return root.sendChatCommand(selectFromAccount.selectedAccount.address,
|
return root.sendChatCommand(selectFromAccount.selectedAccount.address,
|
||||||
txtAmount.selectedAmount,
|
txtAmount.selectedAmount,
|
||||||
|
|
|
@ -60,7 +60,7 @@ ModalPopup {
|
||||||
anchors.rightMargin: Style.current.padding
|
anchors.rightMargin: Style.current.padding
|
||||||
onGroupActivated: {
|
onGroupActivated: {
|
||||||
root.title = group.headerText
|
root.title = group.headerText
|
||||||
btnNext.label = group.footerText
|
btnNext.text = group.footerText
|
||||||
}
|
}
|
||||||
TransactionFormGroup {
|
TransactionFormGroup {
|
||||||
id: group1
|
id: group1
|
||||||
|
@ -196,16 +196,15 @@ ModalPopup {
|
||||||
stack.back()
|
stack.back()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StyledButton {
|
StatusButton {
|
||||||
id: btnNext
|
id: btnNext
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
//% "Next"
|
//% "Next"
|
||||||
label: qsTrId("next")
|
text: qsTrId("next")
|
||||||
disabled: !stack.currentGroup.isValid
|
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const isValid = stack.currentGroup.validate()
|
const validity = stack.currentGroup.validate()
|
||||||
|
if (validity.isValid && !validity.isPending) {
|
||||||
if (stack.currentGroup.validate()) {
|
|
||||||
if (stack.isLastGroup) {
|
if (stack.isLastGroup) {
|
||||||
return root.sendTransaction()
|
return root.sendTransaction()
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,11 +214,9 @@ ModalPopup {
|
||||||
//% "Next"
|
//% "Next"
|
||||||
text: qsTrId("next")
|
text: qsTrId("next")
|
||||||
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
||||||
state: stack.currentGroup.isPending ? "pending" : "default"
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const isValid = stack.currentGroup.validate()
|
const validity = stack.currentGroup.validate()
|
||||||
|
if (validity.isValid && !validity.isPending) {
|
||||||
if (stack.currentGroup.validate()) {
|
|
||||||
if (stack.isLastGroup) {
|
if (stack.isLastGroup) {
|
||||||
return root.sendTransaction()
|
return root.sendTransaction()
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import QtQuick.Layouts 1.13
|
||||||
import QtQuick.Dialogs 1.3
|
import QtQuick.Dialogs 1.3
|
||||||
import "../../../../../imports"
|
import "../../../../../imports"
|
||||||
import "../../../../../shared"
|
import "../../../../../shared"
|
||||||
|
import "../../../../../shared/status"
|
||||||
|
|
||||||
ModalPopup {
|
ModalPopup {
|
||||||
id: root
|
id: root
|
||||||
|
@ -55,7 +56,7 @@ ModalPopup {
|
||||||
anchors.rightMargin: Style.current.padding
|
anchors.rightMargin: Style.current.padding
|
||||||
onGroupActivated: {
|
onGroupActivated: {
|
||||||
root.title = group.headerText
|
root.title = group.headerText
|
||||||
btnNext.label = group.footerText
|
btnNext.text = group.footerText
|
||||||
}
|
}
|
||||||
TransactionFormGroup {
|
TransactionFormGroup {
|
||||||
id: group1
|
id: group1
|
||||||
|
@ -188,12 +189,11 @@ ModalPopup {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
StyledButton {
|
StatusButton {
|
||||||
id: btnNext
|
id: btnNext
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
//% "Next"
|
text: qsTr("Next")
|
||||||
label: qsTrId("next")
|
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
||||||
disabled: !stack.currentGroup.isValid
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const validity = stack.currentGroup.validate()
|
const validity = stack.currentGroup.validate()
|
||||||
if (validity.isValid && !validity.isPending) {
|
if (validity.isValid && !validity.isPending) {
|
||||||
|
|
|
@ -249,7 +249,7 @@ ModalPopup {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
//% "Next"
|
//% "Next"
|
||||||
text: qsTrId("next")
|
text: qsTrId("next")
|
||||||
enabled: !(!stack.currentGroup.isValid || stack.currentGroup.isPending)
|
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
|
||||||
state: stack.currentGroup.isPending ? "pending" : "default"
|
state: stack.currentGroup.isPending ? "pending" : "default"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const validity = stack.currentGroup.validate()
|
const validity = stack.currentGroup.validate()
|
||||||
|
|
Loading…
Reference in New Issue