mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[web] Pending invite prevents Viewer being changed to Editor (#19214)
* only count editor invites when disabling editor in dropdown GitOrigin-RevId: 400215d4817c0146da4f8397fe2007699da0e92b
This commit is contained in:
parent
3b29865d87
commit
fd50db2341
2 changed files with 7 additions and 2 deletions
|
@ -26,9 +26,13 @@ export default function ShareModalBody() {
|
|||
return true
|
||||
}
|
||||
|
||||
const editorInvites = invites.filter(
|
||||
invite => invite.privileges === 'readAndWrite'
|
||||
).length
|
||||
|
||||
return (
|
||||
members.filter(member => member.privileges === 'readAndWrite').length +
|
||||
invites.length <
|
||||
editorInvites <
|
||||
(features.collaborators ?? 1)
|
||||
)
|
||||
}, [members, invites, features, isProjectOwner])
|
||||
|
@ -41,6 +45,7 @@ export default function ShareModalBody() {
|
|||
if (features.collaborators === -1) {
|
||||
return false
|
||||
}
|
||||
|
||||
return (
|
||||
members.filter(member => member.privileges === 'readAndWrite').length >
|
||||
(features.collaborators ?? 1)
|
||||
|
|
|
@ -14,7 +14,7 @@ export type ProjectContextValue = {
|
|||
rootDocId?: string
|
||||
compiler: string
|
||||
members: ProjectContextMember[]
|
||||
invites: { _id: UserId }[]
|
||||
invites: ProjectContextMember[]
|
||||
features: {
|
||||
collaborators?: number
|
||||
compileGroup?: 'alpha' | 'standard' | 'priority'
|
||||
|
|
Loading…
Reference in a new issue