Skip to content

Conversation

@kkartunov
Copy link
Contributor

}
{
membersExist && (
!isLoadingProject && membersExist && (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider checking the isLoadingProject condition earlier in the logic to potentially avoid unnecessary checks or rendering. This might improve readability and performance if isLoadingProject is a common state.

)
}

{isLoadingProject && <Loader />}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a conditional rendering check to ensure that the Loader component is only displayed when necessary. This will prevent unnecessary rendering and improve performance.

projects: PropTypes.arrayOf(PropTypes.object),
projectMembers: PropTypes.arrayOf(PropTypes.object),
invitedMembers: PropTypes.arrayOf(PropTypes.object),
isLoadingProject: PropTypes.bool.isRequired,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of isLoadingProject as a required prop is clear, but ensure that this prop is being used correctly within the component to handle loading states. Double-check if there are any related changes needed in the component logic to accommodate this new prop.

isLoadingProject: false
}
this.loadProject = this.loadProject.bind(this)
this.updateProjectNember = this.updateProjectNember.bind(this)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in method name updateProjectNember. It should likely be updateProjectMember.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hentrymartin can you please commit a fix for this in develop?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkartunov I've added a fix for this!

}

loadProject (projectId) {
this.setState({ isLoadingProject: true })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider handling potential errors from fetchProjectById to ensure isLoadingProject state is properly reset in case of failure.

email: m.email || invitedUsers[m.userId].handle
}))
})),
isLoadingProject: false

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of isLoadingProject: false seems to be outside the scope of the invitedMembers mapping. Ensure that this property is intended to be part of the state update and not mistakenly included within the invitedMembers transformation.

})

const { user, updateProjectNember } = this.props
const { user, updateProjectMember } = this.props

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo fix: The variable updateProjectNember was corrected to updateProjectMember. Ensure that all references to this function are updated throughout the codebase to prevent any potential errors.

loadProject: PropTypes.func.isRequired,
updateProjectNember: PropTypes.func.isRequired,
updateProjectMember: PropTypes.func.isRequired,
removeProjectNember: PropTypes.func.isRequired,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo correction needed: removeProjectNember should be removeProjectMember to match the corrected spelling of updateProjectMember.

this.loadProject = this.loadProject.bind(this)
this.updateProjectNember = this.updateProjectNember.bind(this)
this.updateProjectMember = this.updateProjectMember.bind(this)
this.removeProjectNember = this.removeProjectNember.bind(this)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method removeProjectNember seems to have a typo in its name. Consider renaming it to removeProjectMember to maintain consistency with the corrected method name updateProjectMember.

}

updateProjectNember (newMemberInfo) {
updateProjectMember (newMemberInfo) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name updateProjectMember has been corrected from updateProjectNember. Ensure that all references to this function throughout the codebase are updated to prevent any potential errors.

loadProject={this.loadProject}
updateProjectNember={this.updateProjectNember}
updateProjectMember={this.updateProjectMember}
removeProjectNember={this.removeProjectNember}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name removeProjectNember seems to have a typo similar to the one corrected for updateProjectMember. Consider renaming it to removeProjectMember for consistency and clarity.

if (this.state.isRemoving) { return }

const { removeProjectNember, invitedMembers } = this.props
const { removeProjectMember, invitedMembers } = this.props

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo fix: The variable removeProjectNember was corrected to removeProjectMember. Ensure that this change is consistent throughout the codebase where this variable is used.

}

removeProjectNember (projectMember) {
removeProjectMember (projectMember) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo fix: The method name was corrected from removeProjectNember to removeProjectMember. Ensure that all references to this method throughout the codebase are updated accordingly to prevent any potential errors.

@kkartunov kkartunov merged commit ed41222 into master May 13, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants