import refactor
This commit is contained in:
parent
657c2b830c
commit
d5ef1e071d
1 changed files with 18 additions and 68 deletions
|
|
@ -101,18 +101,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
return;
|
||||
|
||||
}
|
||||
|
||||
walletService.updateRemotePreferences(client, {}, function() {
|
||||
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
|
||||
});
|
||||
|
||||
profileService.setBackupFlag(client.credentials.walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
finish(client);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
|
@ -132,19 +121,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
walletService.updateRemotePreferences(client, {}, function() {
|
||||
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
|
||||
});
|
||||
|
||||
profileService.setBackupFlag(client.credentials.walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
finish(client);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
|
@ -163,13 +140,6 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
|
||||
profileService.setBackupFlag(walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
});
|
||||
}, 100);
|
||||
|
|
@ -193,18 +163,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
$scope.$apply();
|
||||
});
|
||||
}
|
||||
|
||||
walletService.updateRemotePreferences(client, {}, function() {
|
||||
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
|
||||
});
|
||||
|
||||
profileService.setBackupFlag(client.credentials.walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
finish(client);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
|
@ -312,19 +271,7 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
walletService.updateRemotePreferences(wallet, {}, function() {
|
||||
$log.debug('Remote preferences saved for:' + wallet.walletId)
|
||||
});
|
||||
|
||||
profileService.setBackupFlag(wallet.walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
finish(wallet);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
|
@ -388,23 +335,26 @@ angular.module('copayApp.controllers').controller('importController',
|
|||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
walletService.updateRemotePreferences(wallet, {}, function() {
|
||||
$log.debug('Remote preferences saved for:' + wallet.walletId)
|
||||
});
|
||||
|
||||
profileService.setBackupFlag(wallet.walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
finish(wallet);
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
||||
var finish = function(wallet) {
|
||||
|
||||
walletService.updateRemotePreferences(wallet, {}, function() {
|
||||
$log.debug('Remote preferences saved for:' + wallet.credentials.walletId)
|
||||
});
|
||||
|
||||
profileService.setBackupFlag(wallet.credentials.walletId);
|
||||
if ($stateParams.fromOnboarding) {
|
||||
profileService.setDisclaimerAccepted(function(err) {
|
||||
if (err) $log.error(err);
|
||||
});
|
||||
}
|
||||
$state.go('tabs.home');
|
||||
};
|
||||
|
||||
updateSeedSourceSelect();
|
||||
$scope.setSeedSource();
|
||||
if ($stateParams.code) $scope.processWalletInfo($stateParams.code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue