Skip to content

Commit

Permalink
maxCollaborators - Limit
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-ramos committed Sep 3, 2024
1 parent dbebb37 commit fa57564
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dashboard/Settings/Collaborators.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default class Collaborators extends React.Component {
sendInvite(featuresPermission, classesPermission, owner) {
return this.context.sendEmailToInviteCollaborator(this.state.currentEmail, featuresPermission, classesPermission, owner).then((response) => {
if (response.status === 200) {
this.setState({ lastError: '', inviteCollab: false, showDialog: false, lastSuccess: 'The invite has been sent!', currentEmail: '', showBtnCollaborator: false, waiting_collaborators: response.data.response });
this.setState({ lastError: '', inviteCollab: false, showDialog: false, lastSuccess: 'The invite has been sent!', currentEmail: '', showBtnCollaborator: false, waiting_collaborators: response.data.response, limitReached: });
setTimeout(() => {
this.setState({ lastSuccess: '' })
}, 5000);
Expand Down Expand Up @@ -341,7 +341,7 @@ export default class Collaborators extends React.Component {

addCollaboratorField() {
const maxCollaborators = this.context.settings.fields.fields.maxCollaborators;
const limitReached = (this.props.collaborators.length <= this.context.settings.fields.fields.limitReached) ? this.props.collaborators.length : this.context.settings.fields.fields.limitReached;
const limitReached = (this.props.collaborators.length + this.props.waiting_collaborators.length <= this.context.settings.fields.fields.limitReached) ? this.props.collaborators.length : this.context.settings.fields.fields.limitReached;

return (
<Field
Expand Down Expand Up @@ -460,7 +460,7 @@ export default class Collaborators extends React.Component {

render() {
const maxCollaborators = this.context.settings.fields.fields.maxCollaborators;
const limitReached = (this.props.collaborators.length <= this.context.settings.fields.fields.limitReached) ? this.props.collaborators.length : this.context.settings.fields.fields.limitReached;
const limitReached = (this.props.collaborators.length + this.props.waiting_collaborators.length <= this.context.settings.fields.fields.limitReached) ? this.props.collaborators.length : this.context.settings.fields.fields.limitReached;

return (
<Fieldset
Expand Down

0 comments on commit fa57564

Please sign in to comment.