fix email label
This commit is contained in:
parent
d911dd9d0b
commit
3c0bc734a4
4 changed files with 23 additions and 8 deletions
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue