fix: update tx modal validity

This commit is contained in:
emizzle 2020-09-17 19:08:31 +10:00 committed by Iuri Matias
parent 2a59ab402d
commit 1fc0e26a0f
5 changed files with 20 additions and 24 deletions

View File

@ -29,7 +29,7 @@ ModalPopup {
anchors.rightMargin: Style.current.padding
onGroupActivated: {
root.title = group.headerText
btnNext.label = group.footerText
btnNext.text = group.footerText
}
TransactionFormGroup {
id: group1
@ -166,16 +166,15 @@ ModalPopup {
stack.back()
}
}
StyledButton {
StatusButton {
id: btnNext
anchors.right: parent.right
//% "Next"
label: qsTrId("next")
disabled: !stack.currentGroup.isValid
text: qsTrId("next")
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
onClicked: {
const isValid = stack.currentGroup.validate()
if (stack.currentGroup.validate()) {
const validity = stack.currentGroup.validate()
if (validity.isValid && !validity.isPending) {
if (stack.isLastGroup) {
return root.sendChatCommand(selectFromAccount.selectedAccount.address,
txtAmount.selectedAmount,

View File

@ -60,7 +60,7 @@ ModalPopup {
anchors.rightMargin: Style.current.padding
onGroupActivated: {
root.title = group.headerText
btnNext.label = group.footerText
btnNext.text = group.footerText
}
TransactionFormGroup {
id: group1
@ -196,16 +196,15 @@ ModalPopup {
stack.back()
}
}
StyledButton {
StatusButton {
id: btnNext
anchors.right: parent.right
//% "Next"
label: qsTrId("next")
disabled: !stack.currentGroup.isValid
text: qsTrId("next")
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
onClicked: {
const isValid = stack.currentGroup.validate()
if (stack.currentGroup.validate()) {
const validity = stack.currentGroup.validate()
if (validity.isValid && !validity.isPending) {
if (stack.isLastGroup) {
return root.sendTransaction()
}

View File

@ -214,11 +214,9 @@ ModalPopup {
//% "Next"
text: qsTrId("next")
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
state: stack.currentGroup.isPending ? "pending" : "default"
onClicked: {
const isValid = stack.currentGroup.validate()
if (stack.currentGroup.validate()) {
const validity = stack.currentGroup.validate()
if (validity.isValid && !validity.isPending) {
if (stack.isLastGroup) {
return root.sendTransaction()
}

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import "../../../../../imports"
import "../../../../../shared"
import "../../../../../shared/status"
ModalPopup {
id: root
@ -55,7 +56,7 @@ ModalPopup {
anchors.rightMargin: Style.current.padding
onGroupActivated: {
root.title = group.headerText
btnNext.label = group.footerText
btnNext.text = group.footerText
}
TransactionFormGroup {
id: group1
@ -188,12 +189,11 @@ ModalPopup {
anchors.left: parent.left
anchors.right: parent.right
StyledButton {
StatusButton {
id: btnNext
anchors.right: parent.right
//% "Next"
label: qsTrId("next")
disabled: !stack.currentGroup.isValid
text: qsTr("Next")
enabled: stack.currentGroup.isValid && !stack.currentGroup.isPending
onClicked: {
const validity = stack.currentGroup.validate()
if (validity.isValid && !validity.isPending) {

View File

@ -249,7 +249,7 @@ ModalPopup {
anchors.right: parent.right
//% "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: {
const validity = stack.currentGroup.validate()