refactor backup flag process

This commit is contained in:
Javier 2016-08-30 17:07:49 -03:00
commit a9c4762ef7
9 changed files with 77 additions and 90 deletions

View file

@ -109,12 +109,12 @@ angular.module('copayApp.controllers').controller('importController',
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
});
$rootScope.$emit('Local/WalletImported', client.credentials.walletId);
if ($stateParams.fromOnboarding)
profileService.setBackupFlag(client.credentials.walletId);
if ($stateParams.fromOnboarding) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
});
}
$state.go('tabs.home');
});
}, 100);
@ -141,12 +141,12 @@ angular.module('copayApp.controllers').controller('importController',
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
});
$rootScope.$emit('Local/WalletImported', client.credentials.walletId);
if ($stateParams.fromOnboarding)
profileService.setBackupFlag(client.credentials.walletId);
if ($stateParams.fromOnboarding) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
});
}
$state.go('tabs.home');
});
}, 100);
@ -166,12 +166,13 @@ angular.module('copayApp.controllers').controller('importController',
$scope.$apply();
});
}
$rootScope.$emit('Local/WalletImported', walletId);
if ($stateParams.fromOnboarding)
profileService.setBackupFlag(walletId);
if ($stateParams.fromOnboarding) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
});
}
$state.go('tabs.home');
});
}, 100);
@ -200,12 +201,12 @@ angular.module('copayApp.controllers').controller('importController',
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
});
$rootScope.$emit('Local/WalletImported', client.credentials.walletId);
if ($stateParams.fromOnboarding)
profileService.setBackupFlag(client.credentials.walletId);
if ($stateParams.fromOnboarding) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
});
}
$state.go('tabs.home');
});
}, 100);
@ -339,12 +340,13 @@ angular.module('copayApp.controllers').controller('importController',
walletService.updateRemotePreferences(wallet, {}, function() {
$log.debug('Remote preferences saved for:' + wallet.walletId)
});
$rootScope.$emit('Local/WalletImported', wallet.walletId);
if ($stateParams.fromOnboarding)
profileService.setBackupFlag(wallet.walletId);
if ($stateParams.fromOnboarding) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
});
}
$state.go('tabs.home');
});
}, 100);
@ -421,13 +423,13 @@ angular.module('copayApp.controllers').controller('importController',
walletService.updateRemotePreferences(wallet, {}, function() {
$log.debug('Remote preferences saved for:' + wallet.walletId)
});
$rootScope.$emit('Local/WalletImported', wallet.walletId);
if ($stateParams.fromOnboarding)
profileService.setBackupFlag(wallet.walletId);
if ($stateParams.fromOnboarding) {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);
});
}
$state.go('tabs.home');
});
}, 100);