Skip to content

Conversation

@hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-2662

What's in this PR?

  • Show only current users winning submission in winners tab if challenge is private

return true
}, [isCompletedDesignChallenge, isSubmissionsViewable, canViewAllSubmissions])

const filterFunc = useCallback((submissions: ProjectResult[]): ProjectResult[] => submissions

Choose a reason for hiding this comment

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

[💡 performance]
The filterFunc function uses useCallback but does not have any dependencies that are functions or objects that could change. Consider using useMemo instead for consistency with other memoized values in this component.

const filterFunc = useCallback((submissions: ProjectResult[]): ProjectResult[] => submissions
.filter(submission => {
if (!canViewSubmissions) {
return String(submission.userId) === String(loginUserInfo?.userId)

Choose a reason for hiding this comment

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

[⚠️ correctness]
The comparison String(submission.userId) === String(loginUserInfo?.userId) could potentially lead to unexpected behavior if userId is null or undefined. Ensure that userId is always a valid string or number before this comparison.

@hentrymartin hentrymartin merged commit 1ced8a1 into dev Dec 11, 2025
8 checks passed
@hentrymartin hentrymartin deleted the pm-2662_3 branch December 11, 2025 14:30
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