skip confirm dialog on chromeapp
Signed-off-by: Matias Alejo Garcia <ematiu@gmail.com>
This commit is contained in:
parent
801ad1b798
commit
653ce433e1
1 changed files with 29 additions and 16 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue