mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 21:59:00 +02: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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user