From 1ad2df0714a6fcefb51411ad90da4bf455b58e8f Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Fri, 2 Sep 2016 16:36:18 -0300 Subject: [PATCH] fix init wallet view model --- src/js/services/profileService.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 2e11c97d4..9a3ae09fa 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -30,13 +30,12 @@ angular.module('copayApp.services') root.updateWalletSettings = function(wallet) { var defaults = configService.getDefaults(); - var config = configService.getSync(); - - wallet.usingCustomBWS = config.bwsFor && config.bwsFor[wallet.id] && (config.bwsFor[wallet.id] != defaults.bws.url); - - wallet.name = config.aliasFor && (config.aliasFor[wallet.id] || wallet.credentials.walletName); - wallet.color = config.colorFor && (config.colorFor[wallet.id] || '#4A90E2'); - wallet.email = config.emailFor && config.emailFor[wallet.id]; + configService.whenAvailable(function(config){ + wallet.usingCustomBWS = config.bwsFor[wallet.id] && (config.bwsFor[wallet.id] != defaults.bws.url); + wallet.name = config.aliasFor[wallet.id] || wallet.credentials.walletName; + wallet.color = config.colorFor[wallet.id] || '#4A90E2'; + wallet.email = config.emailFor && config.emailFor[wallet.id]; + }); } root.setBackupFlag = function(walletId) { @@ -78,7 +77,7 @@ angular.module('copayApp.services') var opts = opts || {}; var walletId = wallet.credentials.walletId; - if ((root.wallet[walletId] && root.wallet[walletId].started) || opts.force) { + if ((root.wallet[walletId] && root.wallet[walletId].started) && !opts.force) { return false; }