fix init wallet view model

This commit is contained in:
Matias Alejo Garcia 2016-09-02 16:36:18 -03:00
commit 1ad2df0714
No known key found for this signature in database
GPG key ID: 02470DB551277AB3

View file

@ -30,13 +30,12 @@ angular.module('copayApp.services')
root.updateWalletSettings = function(wallet) { root.updateWalletSettings = function(wallet) {
var defaults = configService.getDefaults(); var defaults = configService.getDefaults();
var config = configService.getSync(); configService.whenAvailable(function(config){
wallet.usingCustomBWS = config.bwsFor[wallet.id] && (config.bwsFor[wallet.id] != defaults.bws.url);
wallet.usingCustomBWS = config.bwsFor && 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.name = config.aliasFor && (config.aliasFor[wallet.id] || wallet.credentials.walletName); wallet.email = config.emailFor && config.emailFor[wallet.id];
wallet.color = config.colorFor && (config.colorFor[wallet.id] || '#4A90E2'); });
wallet.email = config.emailFor && config.emailFor[wallet.id];
} }
root.setBackupFlag = function(walletId) { root.setBackupFlag = function(walletId) {
@ -78,7 +77,7 @@ angular.module('copayApp.services')
var opts = opts || {}; var opts = opts || {};
var walletId = wallet.credentials.walletId; 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; return false;
} }