refactor wallet settings

This commit is contained in:
Gabriel Bazán 2016-08-16 16:47:51 -03:00
commit ac7ce0af23
17 changed files with 635 additions and 692 deletions

View file

@ -2,12 +2,14 @@
angular.module('copayApp.controllers').controller('preferencesAliasController',
function($scope, $timeout, configService, profileService, go) {
var fc = profileService.focusedClient;
var walletId = fc.credentials.walletId;
var config = configService.getSync();
config.aliasFor = config.aliasFor || {};
$scope.alias = config.aliasFor[walletId] || fc.credentials.walletName;
$scope.walletName = fc.credentials.walletName;
$scope.alias = config.aliasFor[walletId] || $scope.walletName;
$scope.save = function() {
var opts = {

View file

@ -1,19 +1,18 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, go, profileService, walletService) {
$scope.save = function(form) {
$scope.error = null;
$scope.saving = true;
var fc = profileService.focusedClient;
var email = $scope.email || '';
walletService.updateRemotePreferences(fc, {
email: email,
}, function(err) {
$scope.saving = false;
if (!err)
$rootScope.$emit('Local/EmailUpdated', email);
go.path('preferences');
});
};
});