fix email label

This commit is contained in:
Gabriel Bazán 2016-09-01 17:46:56 -03:00
commit 3c0bc734a4
4 changed files with 23 additions and 8 deletions

View file

@ -1,17 +1,30 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, $scope, $ionicHistory, $stateParams, $ionicNavBarDelegate, gettextCatalog, profileService, walletService) {
angular.module('copayApp.controllers').controller('preferencesEmailController', function($scope, $ionicHistory, $stateParams, $ionicNavBarDelegate, gettextCatalog, profileService, walletService, configService) {
$ionicNavBarDelegate.title(gettextCatalog.getString('Email Notifications'));
var wallet = profileService.getWallet($stateParams.walletId);
var walletId = wallet.credentials.walletId;
var config = configService.getSync();
config.amailFor = config.amailFor || {};
$scope.email = config.emailFor && config.emailFor[walletId];
$scope.save = function(form) {
var wallet = profileService.getWallet($stateParams.walletId);
var email = $scope.email || '';
var opts = {
emailFor: {}
};
opts.emailFor[walletId] = $scope.email;
walletService.updateRemotePreferences(wallet, {
email: email,
email: $scope.email,
}, function(err) {
if (err) $log.warn(err);
$ionicHistory.goBack();
configService.set(opts, function(err) {
if (err) $log.warn(err);
$ionicHistory.goBack();
});
});
};
});

View file

@ -117,7 +117,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
walletService.recreate();
};
$scope.updateTxHistory = function(cb) {
$scope.updateTxHistory = function() {
if ($scope.updatingTxHistory) return;
@ -152,7 +152,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
$timeout(function() {
$scope.$apply();
}, 1);
return cb();
return;
});
});
};
@ -172,7 +172,7 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
$scope.updateAll = function(cb)  {
$scope.updateStatus(false);
$scope.updateTxHistory(cb);
$scope.updateTxHistory();
}
$scope.hideToggle = function() {

View file

@ -122,6 +122,7 @@ angular.module('copayApp.services').factory('configService', function(storageSer
configCache.bwsFor = configCache.bwsFor || {};
configCache.colorFor = configCache.colorFor || {};
configCache.aliasFor = configCache.aliasFor || {};
configCache.emailFor = configCache.emailFor || {};
// Coinbase
// Disabled for testnet

View file

@ -36,6 +36,7 @@ angular.module('copayApp.services')
wallet.name = config.aliasFor && (config.aliasFor[wallet.id] || wallet.credentials.walletName);
wallet.color = config.colorFor && (config.colorFor[wallet.id] || '#4A90E2');
wallet.email = config.emailFor && config.emailFor[wallet.id];
}
root.setBackupFlag = function(walletId) {