fix backup click

This commit is contained in:
Matias Alejo Garcia 2015-09-21 10:18:43 -03:00
commit 8bb221b54b
3 changed files with 25 additions and 12 deletions

View file

@ -6,8 +6,17 @@ angular.module('copayApp.controllers').controller('wordsController',
var msg = gettext('Are you sure you want to delete the backup words?');
var successMsg = gettext('Backup words deleted');
this.done = function() {
$rootScope.$emit('Local/BackupDone');
this.show = false;
this.toggle = function() {
this.show = !this.show;
if (this.show)
$rootScope.$emit('Local/BackupDone');
$timeout(function(){
$scope.$apply();
}, 1);
};
this.delete = function() {

View file

@ -808,6 +808,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}
self.startScan = function(walletId) {
$log.debug('Scanning wallet ' + walletId);
var c = profileService.walletClients[walletId];
if (!c.isComplete()) return;
@ -1022,8 +1023,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/BackupDone', function(event) {
self.needsBackup = false;
$log.debug('Backup done');
storageService.setBackupFlag(self.walletId, function(err) {
if (err) root.showErrorPopup(err);
$log.debug('Backup done stored');
});
});
@ -1034,6 +1037,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/WalletImported', function(event, walletId) {
self.needsBackup = false;
storageService.setBackupFlag(walletId, function() {
$log.debug('Backup done stored');
addressService.expireAddress(walletId, function(err) {
$timeout(function() {
self.startScan(walletId);