From a595c60892528304b94bee223ba1ae96884a5fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 30 Aug 2016 17:31:29 -0300 Subject: [PATCH] set disclaimer flag when import wallet --- src/js/controllers/import.js | 31 +++++++++++++++++++++++++++++++ src/js/services/profileService.js | 1 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/js/controllers/import.js b/src/js/controllers/import.js index a70e5eab4..cb24f92cc 100644 --- a/src/js/controllers/import.js +++ b/src/js/controllers/import.js @@ -110,6 +110,11 @@ angular.module('copayApp.controllers').controller('importController', }); $rootScope.$emit('Local/WalletImported', client.credentials.walletId); + if ($stateParams.fromOnboarding) + profileService.setDisclaimerAccepted(function(err) { + if (err) $log.error(err); + }); + $state.go('tabs.home'); }); }, 100); @@ -137,6 +142,11 @@ angular.module('copayApp.controllers').controller('importController', }); $rootScope.$emit('Local/WalletImported', client.credentials.walletId); + if ($stateParams.fromOnboarding) + profileService.setDisclaimerAccepted(function(err) { + if (err) $log.error(err); + }); + $state.go('tabs.home'); }); }, 100); @@ -157,6 +167,11 @@ angular.module('copayApp.controllers').controller('importController', }); } $rootScope.$emit('Local/WalletImported', walletId); + if ($stateParams.fromOnboarding) + profileService.setDisclaimerAccepted(function(err) { + if (err) $log.error(err); + }); + $state.go('tabs.home'); }); }, 100); @@ -186,6 +201,11 @@ angular.module('copayApp.controllers').controller('importController', }); $rootScope.$emit('Local/WalletImported', client.credentials.walletId); + if ($stateParams.fromOnboarding) + profileService.setDisclaimerAccepted(function(err) { + if (err) $log.error(err); + }); + $state.go('tabs.home'); }); }, 100); @@ -320,6 +340,11 @@ angular.module('copayApp.controllers').controller('importController', $log.debug('Remote preferences saved for:' + wallet.walletId) }); $rootScope.$emit('Local/WalletImported', wallet.walletId); + if ($stateParams.fromOnboarding) + profileService.setDisclaimerAccepted(function(err) { + if (err) $log.error(err); + }); + $state.go('tabs.home'); }); }, 100); @@ -397,6 +422,12 @@ angular.module('copayApp.controllers').controller('importController', $log.debug('Remote preferences saved for:' + wallet.walletId) }); $rootScope.$emit('Local/WalletImported', wallet.walletId); + + if ($stateParams.fromOnboarding) + profileService.setDisclaimerAccepted(function(err) { + if (err) $log.error(err); + }); + $state.go('tabs.home'); }); }, 100); diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 37161dd00..3026753f9 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -462,7 +462,6 @@ angular.module('copayApp.services') if (!client || !client.credentials) return cb(gettext('Could not access wallet')); - if (root.profile) root.profile = Profile.create(); var walletId = client.credentials.walletId if (!root.profile.addWallet(JSON.parse(client.export())))