mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #177 from gabrielbazan7/fix/preferencesAlias
fix alias
This commit is contained in:
commit
aac4fa885b
|
@ -11,7 +11,7 @@
|
|||
<div class="card list">
|
||||
<label class="item item-input item-stacked-label">
|
||||
<span class="input-label" transalate>Alias for {{walletName}}</span>
|
||||
<input type="text" id="alias" name="alias" ng-model="alias" placeholder="John" required>
|
||||
<input type="text" id="alias" name="alias" ng-model="alias.value" placeholder="John" required>
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit"
|
||||
|
|
|
@ -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…
Reference in New Issue