refactor wallet settings
This commit is contained in:
parent
fb83bbba34
commit
ac7ce0af23
17 changed files with 635 additions and 692 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue