add wallet alias

This commit is contained in:
Matias Alejo Garcia 2015-05-14 10:39:22 -03:00
commit d851f62c7f
12 changed files with 118 additions and 17 deletions

View file

@ -102,6 +102,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.txps = [];
self.copayers = [];
self.updateColor();
self.updateAlias();
storageService.getBackupFlag(self.walletId, function(err, val) {
self.needsBackup = self.network == 'testnet' ? false : !val;
@ -344,6 +345,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
};
self.updateAlias = function() {
var config = configService.getSync();
config.aliasFor = config.aliasFor || {};
self.alias = config.aliasFor[self.walletId];
var fc = profileService.focusedClient;
fc.alias = self.alias;
};
self.updateColor = function() {
var config = configService.getSync();
config.colorFor = config.colorFor || {};
@ -552,6 +561,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
});
$rootScope.$on('Local/AliasUpdated', function(event) {
self.updateAlias();
$timeout(function() {
$rootScope.$apply();
});
});
$rootScope.$on('Local/UnitSettingUpdated', function(event) {
self.updateAll();
self.updateTxHistory();