Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ workflows:
context: org-global
filters: &filters-dev
branches:
only: ["v6", "develop"]
only: ["v6", "develop", "pm-2531"]

Choose a reason for hiding this comment

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

[⚠️ maintainability]
Adding a specific branch like pm-2531 to the only filter is fine for feature-specific builds, but ensure this branch is removed or updated once the feature is merged or no longer needed to avoid unnecessary builds in the future.


# Production builds are exectuted only on tagged commits to the
# master branch.
Expand Down
9 changes: 7 additions & 2 deletions src/containers/ProjectInvitations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const ProjectInvitations = ({ match, auth, isProjectLoading, history, projectDet
const projectId = useMemo(() => parseInt(match.params.projectId), [match.params])
const invitation = useMemo(() => checkIsUserInvitedToProject(auth.token, projectDetail), [auth.token, projectDetail])
const [isUpdating, setIsUpdating] = useState(automaticAction || false)
const [isUpdateInprogress, setIsUpdateInprogress] = useState(false)
const isAccepting = isUpdating === PROJECT_MEMBER_INVITE_STATUS_ACCEPTED
const isDeclining = isUpdating === PROJECT_MEMBER_INVITE_STATUS_REFUSED
const queryParams = new URLSearchParams(window.location.search)
Expand All @@ -46,11 +47,15 @@ const ProjectInvitations = ({ match, auth, isProjectLoading, history, projectDet

const updateInvite = useCallback(async (status, source) => {
setIsUpdating(status)
setIsUpdateInprogress(true)
try {
if (isUpdateInprogress) {
return
}
await updateProjectMemberInvite(projectId, invitation.id, status, source)

// await for the project details to propagate
await delay(1000)
setIsUpdateInprogress(false)
await loadProjectInvites(projectId)
toastr.success('Success', `Successfully ${status} the invitation.`)

Expand All @@ -62,7 +67,7 @@ const ProjectInvitations = ({ match, auth, isProjectLoading, history, projectDet
await delay(1000)
history.push('/projects')
}
}, [projectId, invitation, loadProjectInvites, history])
}, [projectId, invitation, loadProjectInvites, history, isUpdateInprogress])

const acceptInvite = useCallback(() => updateInvite(PROJECT_MEMBER_INVITE_STATUS_ACCEPTED, source), [updateInvite, source])
const declineInvite = useCallback(() => updateInvite(PROJECT_MEMBER_INVITE_STATUS_REFUSED, source), [updateInvite, source])
Expand Down