mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
validation on send - unlocked balance
This commit is contained in:
parent
6a386a42fc
commit
2d980b6951
1 changed files with 11 additions and 0 deletions
11
main.qml
11
main.qml
|
@ -326,6 +326,7 @@ ApplicationWindow {
|
||||||
// validate amount;
|
// validate amount;
|
||||||
var amountxmr = walletManager.amountFromString(amount);
|
var amountxmr = walletManager.amountFromString(amount);
|
||||||
console.log("integer amount: ", amountxmr);
|
console.log("integer amount: ", amountxmr);
|
||||||
|
console.log("integer unlocked",currentWallet.unlockedBalance)
|
||||||
if (amountxmr <= 0) {
|
if (amountxmr <= 0) {
|
||||||
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
||||||
informationPopup.text = qsTr("Amount is wrong: expected number from %1 to %2")
|
informationPopup.text = qsTr("Amount is wrong: expected number from %1 to %2")
|
||||||
|
@ -333,6 +334,16 @@ ApplicationWindow {
|
||||||
.arg(walletManager.maximumAllowedAmountAsSting())
|
.arg(walletManager.maximumAllowedAmountAsSting())
|
||||||
+ translationManager.emptyString
|
+ translationManager.emptyString
|
||||||
|
|
||||||
|
informationPopup.icon = StandardIcon.Critical
|
||||||
|
informationPopup.onCloseCallback = null
|
||||||
|
informationPopup.open()
|
||||||
|
return;
|
||||||
|
} else if (amountxmr > currentWallet.unlockedBalance) {
|
||||||
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
||||||
|
informationPopup.text = qsTr("insufficient funds. Unlocked balance: %1")
|
||||||
|
.arg(walletManager.displayAmount(currentWallet.unlockedBalance))
|
||||||
|
+ translationManager.emptyString
|
||||||
|
|
||||||
informationPopup.icon = StandardIcon.Critical
|
informationPopup.icon = StandardIcon.Critical
|
||||||
informationPopup.onCloseCallback = null
|
informationPopup.onCloseCallback = null
|
||||||
informationPopup.open()
|
informationPopup.open()
|
||||||
|
|
Loading…
Reference in a new issue