mirror of https://github.com/BTCPrivate/copay.git
update local storage when a wallet is deleted
This commit is contained in:
parent
6e355bba3f
commit
061ec1d1fd
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
||||||
function($scope, $rootScope, $filter, $timeout, $modal, $log, notification, profileService, isCordova, go, gettext, gettextCatalog, animationService) {
|
function($scope, $rootScope, $filter, $timeout, $modal, $log, storageService, notification, profileService, isCordova, go, gettext, gettextCatalog, animationService) {
|
||||||
this.isCordova = isCordova;
|
this.isCordova = isCordova;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
|
||||||
|
@ -46,14 +46,19 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
|
||||||
var _deleteWallet = function() {
|
var _deleteWallet = function() {
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var name = fc.credentials.walletName;
|
var name = fc.credentials.walletName;
|
||||||
var walletName = (fc.alias||'') + ' [' + name + ']';
|
var walletName = (fc.alias || '') + ' [' + name + ']';
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
profileService.deleteWalletFC({}, function(err) {
|
profileService.deleteWalletFC({}, function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
self.error = err.message || err;
|
self.error = err.message || err;
|
||||||
} else {
|
} else {
|
||||||
notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName}));
|
storageService.removeTxHistory(fc.credentials.walletId, function() {
|
||||||
|
notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {
|
||||||
|
walletName: walletName
|
||||||
|
}));
|
||||||
|
return;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -224,12 +224,9 @@ angular.module('copayApp.services')
|
||||||
storage.get('txsHistory-' + walletId, cb);
|
storage.get('txsHistory-' + walletId, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.setTxHistoryFlag = function(value, walletId, cb) {
|
root.removeTxHistory = function(walletId, cb) {
|
||||||
storage.set('txsHistoryFlag-' + walletId, value, cb);
|
storage.remove('txsHistory-' + walletId, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
root.getTxHistoryFlag = function(walletId, cb) {
|
|
||||||
storage.get('txsHistoryFlag-' + walletId, cb);
|
|
||||||
}
|
|
||||||
return root;
|
return root;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue