Skip to content

Commit

Permalink
Merge pull request #54
Browse files Browse the repository at this point in the history
2d980b6 validation on send - unlocked balance (Jacob Brydolf)
  • Loading branch information
fluffypony committed Oct 12, 2016
2 parents 6a386a4 + 2d980b6 commit 8764a74
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.qml
Expand Up @@ -326,13 +326,24 @@ 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")
.arg(walletManager.displayAmount(0))
.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()
Expand Down

0 comments on commit 8764a74

Please sign in to comment.