fix: code review

This commit is contained in:
Richard Ramos 2020-09-16 08:58:08 -04:00 committed by Iuri Matias
parent 6a42124489
commit 24e01ffa7c
2 changed files with 4 additions and 25 deletions

View File

@ -11,7 +11,6 @@ ModalPopup {
property string ensUsername: "" property string ensUsername: ""
property string ensPrice: "10" property string ensPrice: "10"
property bool showBackBtn: false
title: qsTr("Authorize %1 %2").arg(Utils.stripTrailingZeros(ensPrice)).arg(asset.symbol) title: qsTr("Authorize %1 %2").arg(Utils.stripTrailingZeros(ensPrice)).arg(asset.symbol)
property MessageDialog sendingError: MessageDialog { property MessageDialog sendingError: MessageDialog {
@ -72,10 +71,6 @@ ModalPopup {
headerText: qsTr("Authorize %1 %2").arg(Utils.stripTrailingZeros(root.ensPrice)).arg(root.asset.symbol) headerText: qsTr("Authorize %1 %2").arg(Utils.stripTrailingZeros(root.ensPrice)).arg(root.asset.symbol)
footerText: qsTr("Continue") footerText: qsTr("Continue")
StackView.onActivated: {
btnBack.visible = root.showBackBtn
}
AccountSelector { AccountSelector {
id: selectFromAccount id: selectFromAccount
accounts: walletModel.accounts accounts: walletModel.accounts
@ -116,7 +111,7 @@ ModalPopup {
} }
property var estimateGas: Backpressure.debounce(gasSelector, 600, function() { property var estimateGas: Backpressure.debounce(gasSelector, 600, function() {
if (!(root.ensUsername !== "" && selectFromAccount.selectedAccount)) { if (!(root.ensUsername !== "" && selectFromAccount.selectedAccount)) {
selectedGasLimit = 325000 selectedGasLimit = 380000
return return
} }
selectedGasLimit = profileModel.ens.registerENSGasEstimate(root.ensUsername, selectFromAccount.selectedAccount.address) selectedGasLimit = profileModel.ens.registerENSGasEstimate(root.ensUsername, selectFromAccount.selectedAccount.address)
@ -143,10 +138,6 @@ ModalPopup {
headerText: qsTr("Authorize %1 %2").arg(Utils.stripTrailingZeros(root.ensPrice)).arg(root.asset.symbol) headerText: qsTr("Authorize %1 %2").arg(Utils.stripTrailingZeros(root.ensPrice)).arg(root.asset.symbol)
footerText: qsTr("Sign with password") footerText: qsTr("Sign with password")
StackView.onActivated: {
btnBack.visible = true
}
TransactionPreview { TransactionPreview {
id: pvwTransaction id: pvwTransaction
width: stack.width width: stack.width
@ -198,26 +189,15 @@ ModalPopup {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
StyledButton {
id: btnBack
anchors.left: parent.left
//% "Back"
label: qsTrId("back")
onClicked: {
if (stack.isFirstGroup) {
return root.close()
}
stack.back()
}
}
StyledButton { StyledButton {
id: btnNext id: btnNext
anchors.right: parent.right anchors.right: parent.right
label: qsTr("Next") label: qsTr("Next")
disabled: !stack.currentGroup.isValid disabled: !stack.currentGroup.isValid
onClicked: { onClicked: {
const validity = stack.currentGroup.validate()
if (stack.currentGroup.validate()) { if (validity.isValid && !validity.isPending) {
if (stack.isLastGroup) { if (stack.isLastGroup) {
return root.sendTransaction() return root.sendTransaction()
} }

View File

@ -27,7 +27,6 @@ Item {
ensUsername: username ensUsername: username
width: 400 width: 400
height: 400 height: 400
showBackBtn: false
} }
ModalPopup { ModalPopup {