skip confirm dialog on chromeapp

Signed-off-by: Matias Alejo Garcia <ematiu@gmail.com>
This commit is contained in:
Matias Alejo Garcia 2015-06-28 11:03:28 -03:00
commit 653ce433e1

View file

@ -1022,25 +1022,38 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.setForm(null, amount);
};
this.confirmDialog = function(msg, cb) {
if (isCordova) {
navigator.notification.confirm(
msg,
function(buttonIndex) {
if (buttonIndex == 1) {
$timeout(function() {
return cb(true);
}, 1);
} else {
return cb(false);
}
}
);
} else if (isChromeApp) {
// No feedback, alert/confirm not supported.
return cb(true);
} else {
return cb(confirm(msg));
}
};
this.sendAll = function(amount, feeStr) {
var self = this;
var msg = gettextCatalog.getString("{{fee}} will be discounted for bitcoin networking fees", {
fee: feeStr
});
if (isCordova) {
navigator.notification.confirm(
msg,
function(buttonIndex) {
if (buttonIndex == 1)
$timeout(function() {
this.confirmDialog(msg, function(confirmed){
if (confirmed)
self._doSendAll(amount);
}, 1);
}
);
} else {
if (confirm(msg))
this._doSendAll(amount);
}
});
}
/* Start setup */