mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #8704 from overleaf/ta-multiple-invites-fix
Fix UX on Duplicate Group Invites GitOrigin-RevId: e51c406d578b130972024065f9b8bdb2503944a9
This commit is contained in:
parent
e48c23546e
commit
5bfb1b8781
3 changed files with 9 additions and 1 deletions
|
@ -174,6 +174,7 @@ function createInvite(subscription, email, inviter, callback) {
|
|||
)
|
||||
|
||||
if (invite) {
|
||||
invite = invite.toObject()
|
||||
invite.sentAt = new Date()
|
||||
} else {
|
||||
invite = {
|
||||
|
|
|
@ -56,7 +56,12 @@ App.controller('UserMembershipController', function ($scope, queuedHttp) {
|
|||
$scope.inputs.addMembers.inflightCount -= 1
|
||||
const { data } = response
|
||||
if (data.user != null) {
|
||||
$scope.users.push(data.user)
|
||||
const alreadyListed = $scope.users.find(
|
||||
scopeUser => scopeUser.email === data.user.email
|
||||
)
|
||||
if (!alreadyListed) {
|
||||
$scope.users.push(data.user)
|
||||
}
|
||||
}
|
||||
return ($scope.inputs.addMembers.content = '')
|
||||
})
|
||||
|
|
|
@ -23,6 +23,8 @@ describe('TeamInvitesHandler', function () {
|
|||
email: 'jorah@example.com',
|
||||
token: this.token,
|
||||
}
|
||||
// ensure teamInvite can be converted from Document to Object
|
||||
this.teamInvite.toObject = () => this.teamInvite
|
||||
|
||||
this.subscription = {
|
||||
id: '55153a8014829a865bbf700d',
|
||||
|
|
Loading…
Reference in a new issue