mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 15:10:48 +02:00
Catch invalid email address and show specific error message
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user