added password exists validation to join form

This commit is contained in:
Mario Colque 2014-05-01 16:28:07 -03:00
parent 4617a24bbe
commit 4f4fa56db4
1 changed files with 3 additions and 1 deletions

View File

@ -34,11 +34,13 @@ angular.module('copay.signin').controller('SigninController',
walletFactory.joinCreateSession($scope.connectionId, $scope.nickname, function(err,w) {
$scope.loading = false;
if (err || !w) {
if (err || !w || !$scope.joinPassword) {
if (err === 'joinError')
$rootScope.flashMessage = { message: 'Can not find peer'};
else if (err === 'badSecret')
$rootScope.flashMessage = { message: 'Bad secret secret string', type: 'error'};
else if (!$scope.joinPassword)
$rootScope.flashMessage = { message: 'Enter your wallet password', type: 'error' };
else
$rootScope.flashMessage = { message: 'Unknown error', type: 'error'};
controllerUtils.onErrorDigest();