Password required when create new wallet (#284).

This commit is contained in:
Gustavo Cortez 2014-05-06 15:06:37 -03:00
commit ceb97b29e6
2 changed files with 12 additions and 6 deletions

View file

@ -209,6 +209,7 @@
Creating new wallet...
</div>
<div ng-show="!loading">
<form name="setupForm" ng-submit="create(setupForm)" novalidate>
<div class="row">
<div class="small-12 medium-8 medium-centered large-8 large-centered columns box-setup">
<div class="large-6 columns line-dashed-v">
@ -232,27 +233,27 @@
</div>
</div>
<div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v">
<h6>Wallet Password</h6>
<h6>Wallet Password <small>Required</small></h6>
<input type="password" class="form-control" ng-model="walletPassword" required>
</div>
<div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v">
<h6>Wallet name <small>(optional)</small></h6>
<h6>Wallet name <small>Optional</small></h6>
<input type="text" class="form-control" ng-model="walletName">
</div>
<div class="large-6 large-centered columns m30v">
<h6>Your name <small>(optional)</small></h6>
<h6>Your name <small>Optional</small></h6>
<input type="text" class="form-control" ng-model="myNickname">
</div>
</div>
<div class="row">
<div class="large-12 columns line-dashed">
<button class="button primary radius right" type="button"
ng-click="create()">
<button type="submit" class="button primary radius right" ng-disabled="setupForm.$invalid || loading">
Create {{requiredCopayers}}-of-{{totalCopayers}} wallet
</button>
<a class="button secondary radius" href="#signin">Go back</a>
</div>
</div>
</form>
</div>
</div>
</script>

View file

@ -32,7 +32,12 @@ angular.module('copay.setup').controller('SetupController',
updateRCSelect(tc);
});
$scope.create = function() {
$scope.create = function(form) {
if (form && form.$invalid) {
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
return;
}
$scope.loading = true;
var passphrase = Passphrase.getBase64($scope.walletPassword);