fixes SHARED Wallet status, and refresh until it changes

This commit is contained in:
Matias Alejo Garcia 2016-03-09 11:53:47 -03:00
commit 3b5387fb70
7 changed files with 103 additions and 35 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').factory('go', function($window, $rootScope, $location, $state, $timeout, profileService, nodeWebkit) {
angular.module('copayApp.services').factory('go', function($window, $rootScope, $location, $state, $timeout, $log, profileService, nodeWebkit) {
var root = {};
var hideSidebars = function() {
@ -55,6 +55,7 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
root.walletHome = function() {
var fc = profileService.focusedClient;
if (fc && !fc.isComplete()) {
$log.debug("Wallet not complete at startup... redirecting")
root.path('copayers');
} else {
root.path('walletHome', function() {

View file

@ -92,7 +92,7 @@ angular.module('copayApp.services')
$log.debug('Wallet completed');
root.updateCredentialsFC(function() {
$rootScope.$emit('Local/WalletCompleted')
$rootScope.$emit('Local/WalletCompleted', client.credentials.walletId);
});
});
@ -151,6 +151,13 @@ angular.module('copayApp.services')
};
root.getProfile = function(cb) {
storageService.getProfile(function(err, profile) {
return cb(err, profile);
});
};
root.loadAndBindProfile = function(cb) {
storageService.getProfile(function(err, profile) {
if (err) {