Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui improvements to review listings #1734

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ARADDCC002
Copy link
Member

No description provided.

@@ -40,6 +41,7 @@ export default function AccessRequestReview() {
return setErrorMessage('Could not find access request ID')
}

setIsReviewButtonLoading(false)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be setIsReviewButtonLoading(true)?

setAcceptedReviewResponses(updatedApprovals)
setChangesRequestedReviewResponses(updatedRequests)
}, [reviewResponses])
const orderedReviewResponses = useMemo(() => reviewResponses.sort(sortByCreatedAtDescending) || [], [reviewResponses])
Copy link
Member

Choose a reason for hiding this comment

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

As .sort() mutates the existing array, I'd suggest using reviewResponses.toSorted(sortByCreatedAtDescending). This works the same as .sort() but leaves the original array untouched which will avoid any unwanted behaviour in parent components.

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't know about toSorted interesting!

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