fix delete wallet in fileStorage

This commit is contained in:
Matias Alejo Garcia 2015-05-18 10:30:09 -03:00
commit 2fbb6f4c9a
2 changed files with 7 additions and 6 deletions

View file

@ -24,18 +24,19 @@ angular.module('copayApp.services')
$log.debug('Set focus:', walletId);
// Set local object
root.focusedClient = root.walletClients[walletId];
if (walletId)
root.focusedClient = root.walletClients[walletId];
else
root.focusedClient = [];
if (lodash.isEmpty(root.focusedClient)) {
root.focusedClient = root.walletClients[lodash.keys(root.walletClients)[0]];
}
// Still nothing?
if (lodash.isEmpty(root.focusedClient)) {
$rootScope.$emit('Local/NoWallets');
}
// set if completed
if (!lodash.isEmpty(root.focusedClient)) {
} else {
$rootScope.$emit('Local/NewFocusedWallet');
}

View file

@ -124,7 +124,7 @@ angular.module('copayApp.services')
};
root.storeFocusedWalletId = function(id, cb) {
storage.set('focusedWalletId', id, cb);
storage.set('focusedWalletId', id||'', cb);
};
root.getFocusedWalletId = function(cb) {