fix alias
This commit is contained in:
parent
279b1c274f
commit
2b3fb7eea4
2 changed files with 6 additions and 4 deletions
|
|
@ -3,18 +3,20 @@
|
|||
angular.module('copayApp.controllers').controller('preferencesAliasController',
|
||||
function($scope, $timeout, $stateParams, $ionicHistory, gettextCatalog, configService, profileService, walletService) {
|
||||
var wallet = profileService.getWallet($stateParams.walletId);
|
||||
$scope.wallet = wallet;
|
||||
var walletId = wallet.credentials.walletId;
|
||||
var config = configService.getSync();
|
||||
|
||||
$scope.walletName = wallet.credentials.walletName;
|
||||
$scope.alias = (config.aliasFor && config.aliasFor[walletId]) || wallet.walletName;
|
||||
$scope.alias = {
|
||||
value: (config.aliasFor && config.aliasFor[walletId]) || wallet.credentials.walletName
|
||||
};
|
||||
|
||||
$scope.save = function() {
|
||||
var opts = {
|
||||
aliasFor: {}
|
||||
};
|
||||
opts.aliasFor[walletId] = $scope.alias;
|
||||
|
||||
opts.aliasFor[walletId] = $scope.alias.value;
|
||||
|
||||
configService.set(opts, function(err) {
|
||||
if (err) $log.warn(err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue