Merge pull request #609 from jamal-jackson/feature/wallet_preferences_name_change
redefined logic to use wallet name only if not present alias available
This commit is contained in:
commit
f9435307ef
2 changed files with 3 additions and 9 deletions
|
|
@ -7,8 +7,9 @@ angular.module('copayApp.controllers').controller('preferencesAliasController',
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
|
|
||||||
$scope.walletName = wallet.credentials.walletName;
|
$scope.walletName = wallet.credentials.walletName;
|
||||||
|
$scope.walletAlias = config.aliasFor && config.aliasFor[walletId] ? config.aliasFor[walletId] : wallet.credentials.walletName;
|
||||||
$scope.alias = {
|
$scope.alias = {
|
||||||
value: (config.aliasFor && config.aliasFor[walletId]) || wallet.credentials.walletName
|
value: $scope.walletAlias
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.save = function() {
|
$scope.save = function() {
|
||||||
|
|
@ -23,11 +24,4 @@ angular.module('copayApp.controllers').controller('preferencesAliasController',
|
||||||
$ionicHistory.goBack();
|
$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();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
<button type="submit"
|
<button type="submit"
|
||||||
class="button button-standard button-primary"
|
class="button button-standard button-primary"
|
||||||
ng-disabled="disableSave" translate>
|
ng-disabled="aliasForm.$invalid || (alias.value == walletAlias)" translate>
|
||||||
Save
|
Save
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue