remove flashmessages from signin

This commit is contained in:
Manuel Araoz 2014-06-26 17:22:41 -03:00
commit 40a07e9647

View file

@ -15,10 +15,7 @@ angular.module('copayApp.controllers').controller('SigninController',
$scope.open = function(form) { $scope.open = function(form) {
if (form && form.$invalid) { if (form && form.$invalid) {
$rootScope.$flashMessage = { notification.error('Error', 'Please enter the required fields');
message: 'Please, enter required fields',
type: 'error'
};
return; return;
} }
@ -36,10 +33,7 @@ angular.module('copayApp.controllers').controller('SigninController',
}; };
if (!w) { if (!w) {
$scope.loading = false; $scope.loading = false;
$rootScope.$flashMessage = { notification.error('Error', errMsg || 'Wrong password');
message: errMsg || 'Wrong password',
type: 'error'
};
$rootScope.$digest(); $rootScope.$digest();
return; return;
} }
@ -49,10 +43,7 @@ angular.module('copayApp.controllers').controller('SigninController',
$scope.join = function(form) { $scope.join = function(form) {
if (form && form.$invalid) { if (form && form.$invalid) {
$rootScope.$flashMessage = { notification.error('Error', 'Please enter the required fields');
message: 'Please, enter required fields',
type: 'error'
};
return; return;
} }
@ -64,29 +55,15 @@ angular.module('copayApp.controllers').controller('SigninController',
$scope.loading = false; $scope.loading = false;
if (err || !w) { if (err || !w) {
if (err === 'joinError') if (err === 'joinError')
$rootScope.$flashMessage = { notification.error('Can\'t find peer.');
message: 'Can\'t find peer'
};
else if (err === 'walletFull') else if (err === 'walletFull')
$rootScope.$flashMessage = { notification.error('The wallet is full');
message: 'The wallet is full',
type: 'error'
};
else if (err === 'badNetwork') else if (err === 'badNetwork')
$rootScope.$flashMessage = { notification.error('Network Error', 'The wallet your are trying to join uses a different Bitcoin Network. Check your settings.');
message: 'The wallet your are trying to join uses a different Bitcoin Network. Check your settings.',
type: 'error'
};
else if (err === 'badSecret') else if (err === 'badSecret')
$rootScope.$flashMessage = { notification.error('Bad secret', 'The secret string you entered is invalid');
message: 'Bad secret secret string',
type: 'error'
};
else else
$rootScope.$flashMessage = { notification.error('Unknown error');
message: 'Unknown error',
type: 'error'
};
controllerUtils.onErrorDigest(); controllerUtils.onErrorDigest();
} else { } else {
controllerUtils.startNetwork(w, $scope); controllerUtils.startNetwork(w, $scope);