mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-10 11:52:05 +02:00
Disable send button when there is an insufficient unlocked balance
This commit is contained in:
parent
959c2fcc32
commit
90818efe5e
@ -332,12 +332,29 @@ Rectangle {
|
|||||||
rightIcon: "../images/rightIcon.png"
|
rightIcon: "../images/rightIcon.png"
|
||||||
Layout.topMargin: 4 * scaleRatio
|
Layout.topMargin: 4 * scaleRatio
|
||||||
text: qsTr("Send") + translationManager.emptyString
|
text: qsTr("Send") + translationManager.emptyString
|
||||||
|
// Send button is enabled when:
|
||||||
enabled : {
|
enabled : {
|
||||||
// Send button is enabled when:
|
// Currently opened wallet is not view-only
|
||||||
// 1) Currently opened wallet is not view-only
|
if(appWindow.viewOnly){
|
||||||
// 2) There is no warning box displayed
|
return false;
|
||||||
// 3) The transactional information is correct
|
}
|
||||||
return !appWindow.viewOnly && warningText.text === '' && pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype);
|
|
||||||
|
// There is no warning box displayed
|
||||||
|
if(warningText.text !== ''){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The transactional information is correct
|
||||||
|
if(!pageRoot.checkInformation(amountLine.text, addressLine.text, paymentIdLine.text, appWindow.persistentSettings.nettype)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// There are sufficient unlocked funds available
|
||||||
|
if(parseInt(amountLine.text) > parseInt(unlockedBalanceText)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("Transfer: paymentClicked")
|
console.log("Transfer: paymentClicked")
|
||||||
|
Loading…
Reference in New Issue
Block a user