changed 'email' to 'username' for localstorage

This commit is contained in:
Ivan Socolsky 2014-12-15 14:46:36 -03:00
parent 468625a62d
commit 013753e1bc
1 changed files with 4 additions and 2 deletions

View File

@ -125,12 +125,14 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
if (err) {
$rootScope.starting = false;
copay.logger.warn(err);
var identifier = $scope.usingLocalStorage ? 'username' : 'email';
if ((err.toString() || '').match('PNOTFOUND')) {
$scope.error = 'Invalid email or password';
$scope.error = 'Invalid ' + identifier + ' or password';
if ($scope.attempt++ > 1) {
var storage = $scope.usingLocalStorage ? 'this device storage' : 'cloud storage';
$scope.error = 'Invalid email or password. You are trying to sign in using ' + storage + '. Change it on settings if necessary.';
$scope.error = 'Invalid ' + identifier + ' or password. You are trying to sign in using ' + storage + '. Change it on settings if necessary.';
};
$rootScope.hasPin = false;