redefined logic to use wallet name only if not present alias available

This commit is contained in:
Jamal Jackson 2016-10-20 09:51:01 -04:00
commit 6ee9fbe77c
2 changed files with 2 additions and 8 deletions

View file

@ -7,6 +7,7 @@ angular.module('copayApp.controllers').controller('preferencesAliasController',
var config = configService.getSync();
$scope.walletName = wallet.credentials.walletName;
$scope.walletAlias = config.aliasFor[walletId] || wallet.credentials.walletName;
$scope.alias = {
value: (config.aliasFor && config.aliasFor[walletId]) || wallet.credentials.walletName
};
@ -23,11 +24,4 @@ angular.module('copayApp.controllers').controller('preferencesAliasController',
$ionicHistory.goBack();
});
};
$scope.valueCheck = function() {
if ($scope.alias.value == wallet.credentials.walletName || $scope.alias.value == '') $scope.disableSave = true;
else $scope.disableSave = false;
};
$scope.$watch('alias.value', function(newvalue, oldvalue) {
$scope.valueCheck();
});
});

View file

@ -20,7 +20,7 @@
</div>
<button type="submit"
class="button button-standard button-primary"
ng-disabled="disableSave" translate>
ng-disabled="aliasForm.$invalid || (alias.value == walletAlias)" translate>
Save
</button>
</form>