mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Catch invalid email address and show specific error message
This commit is contained in:
parent
79566a9214
commit
320466a4f7
2 changed files with 7 additions and 2 deletions
|
@ -147,6 +147,8 @@ script(type='text/ng-template', id='shareProjectModalTemplate')
|
|||
| #{translate("cannot_invite_non_user")}
|
||||
span(ng-switch-when="cannot_invite_self")
|
||||
| #{translate("cannot_invite_self")}
|
||||
span(ng-switch-when="invalid_email")
|
||||
| #{translate("invalid_email")}
|
||||
span(ng-switch-default)
|
||||
| #{translate("generic_something_went_wrong")}
|
||||
button.btn.btn-default(
|
||||
|
|
|
@ -127,10 +127,13 @@ define [
|
|||
# with new collaborator information.
|
||||
addNextMember()
|
||||
, 0
|
||||
.catch () ->
|
||||
.catch (err) ->
|
||||
$scope.state.inflight = false
|
||||
$scope.state.error = true
|
||||
$scope.state.errorReason = null
|
||||
if (err.status? and err.status == 400)
|
||||
$scope.state.errorReason = 'invalid_email'
|
||||
else
|
||||
$scope.state.errorReason = null
|
||||
|
||||
$timeout addMembers, 50 # Give email list a chance to update
|
||||
|
||||
|
|
Loading…
Reference in a new issue