new onGoingProcess
This commit is contained in:
parent
c294097c1d
commit
90dad5b2a8
33 changed files with 200 additions and 267 deletions
|
|
@ -1,11 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
||||
function($scope, $rootScope, $filter, $timeout, $modal, $log, $ionicModal, storageService, notification, profileService, platformInfo, go, gettext, gettextCatalog, applicationService) {
|
||||
function($scope, $rootScope, $filter, $timeout, $modal, $log, $ionicModal, storageService, notification, profileService, platformInfo, go, gettext, gettextCatalog, applicationService, ongoingProcess) {
|
||||
var isCordova = platformInfo.isCordova;
|
||||
this.isCordova = isCordova;
|
||||
this.error = null;
|
||||
$scope.isDeletingWallet = false;
|
||||
|
||||
var delete_msg = gettextCatalog.getString('Are you sure you want to delete this wallet?');
|
||||
var accept_msg = gettextCatalog.getString('Accept');
|
||||
|
|
@ -30,14 +29,14 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
|
|||
};
|
||||
|
||||
var doDeleteWallet = function() {
|
||||
$scope.isDeletingWallet = true;
|
||||
ongoingProcess.set('deletingWallet', true);
|
||||
var fc = profileService.focusedClient;
|
||||
var name = fc.credentials.walletName;
|
||||
var walletName = (fc.alias || '') + ' [' + name + ']';
|
||||
var self = this;
|
||||
|
||||
profileService.deleteWalletClient(fc, function(err) {
|
||||
$scope.isDeletingWallet = false;
|
||||
ongoingProcess.set('deletingWallet', false);
|
||||
if (err) {
|
||||
self.error = err.message || err;
|
||||
} else {
|
||||
|
|
@ -50,7 +49,6 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
|
|||
};
|
||||
|
||||
this.deleteWallet = function() {
|
||||
if ($scope.isDeletingWallet) return;
|
||||
if (isCordova) {
|
||||
navigator.notification.confirm(
|
||||
delete_msg,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue