mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Tidy up, and fall back to handling data.users.
This commit is contained in:
parent
ed65e16e54
commit
254705c3f1
1 changed files with 10 additions and 2 deletions
|
@ -51,7 +51,6 @@ define [
|
|||
, (response) ->
|
||||
console.error response
|
||||
)
|
||||
window._x = getOutstandingInvites
|
||||
|
||||
$scope.filterAutocompleteUsers = ($query) ->
|
||||
currentMemberEmails = getCurrentMemberEmails()
|
||||
|
@ -84,7 +83,7 @@ define [
|
|||
# Skip this existing member
|
||||
return addNextMember()
|
||||
|
||||
# TODO: double-check if member.type == 'user' needs to be an invite
|
||||
# NOTE: groups aren't really a thing in ShareLaTeX, partially inherited from DJ
|
||||
if member.type == "user"
|
||||
request = projectInvites.sendInvite(member.email, $scope.inputs.privileges)
|
||||
else if member.type == "group"
|
||||
|
@ -97,6 +96,15 @@ define [
|
|||
if data.invite
|
||||
invite = data.invite
|
||||
$scope.state.invites.push invite
|
||||
else
|
||||
if data.users?
|
||||
users = data.users
|
||||
else if data.user?
|
||||
users = [data.user]
|
||||
else
|
||||
users = []
|
||||
$scope.project.members.push users...
|
||||
|
||||
setTimeout () ->
|
||||
# Give $scope a chance to update $scope.canAddCollaborators
|
||||
# with new collaborator information.
|
||||
|
|
Loading…
Reference in a new issue