Merge pull request #54

2d980b6 validation on send - unlocked balance (Jacob Brydolf)
This commit is contained in:
Riccardo Spagni 2016-10-12 20:31:39 +02:00
commit 8764a74d08
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

View File

@ -326,6 +326,7 @@ ApplicationWindow {
// validate amount;
var amountxmr = walletManager.amountFromString(amount);
console.log("integer amount: ", amountxmr);
console.log("integer unlocked",currentWallet.unlockedBalance)
if (amountxmr <= 0) {
informationPopup.title = qsTr("Error") + translationManager.emptyString;
informationPopup.text = qsTr("Amount is wrong: expected number from %1 to %2")
@ -333,6 +334,16 @@ ApplicationWindow {
.arg(walletManager.maximumAllowedAmountAsSting())
+ 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.onCloseCallback = null
informationPopup.open()