From e03b0db1508442994c2220ec31f70766acdc112b Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Mon, 21 Apr 2014 11:34:08 -0300 Subject: [PATCH] check if your balance is enough to send money --- js/controllers/send.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/controllers/send.js b/js/controllers/send.js index 91cf5d297..d25caa6fd 100644 --- a/js/controllers/send.js +++ b/js/controllers/send.js @@ -20,6 +20,11 @@ angular.module('copay.send').controller('SendController', return; } + if ($rootScope.totalBalance <= form.amount.$modelValue) { + $rootScope.flashMessage = { message: 'You have not enough amount to send', type: 'error'}; + return; + } + var address = form.address.$modelValue; var amount = (form.amount.$modelValue * 100000000).toString(); // satoshi to string