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

Fix nomination button disabled state with unresolved issues and discussion post editing #10907

Merged

Conversation

notbakaneko
Copy link
Collaborator

@notbakaneko notbakaneko commented Jan 29, 2024

Should be incrementing the count before returning ( ゚ ヮ゚)a
Also fix the resolved check for editing posts
fixes #10906

The nomination will still fail if there are unresolved issues

@notbakaneko notbakaneko force-pushed the fix-nominated-button-unresolved-issue-count branch from 4161ee5 to 05f4fd1 Compare January 29, 2024 17:17
@notbakaneko notbakaneko changed the title Fix nomination button disabled state with unresolved issues Fix nomination button disabled state with unresolved issues and discussion post editing Jan 29, 2024
@peppy peppy requested a review from nanaya January 30, 2024 05:02
because it's about the state change not if it's currently resolved.
@@ -257,10 +257,10 @@ export default class DiscussionsState {
return this.nonDeletedDiscussions
.reduce((sum, discussion) => {
if (discussion.can_be_resolved && !discussion.resolved) {
if (discussion.beatmap_id == null) return sum++;
if (discussion.beatmap_id == null) return ++sum;
Copy link
Collaborator

Choose a reason for hiding this comment

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

might as well just sum + 1 instead of dealing with subtlety of ++ operator. And it's not like the variable itself needs to be updated.

@nanaya nanaya enabled auto-merge January 30, 2024 13:15
@nanaya nanaya merged commit 7be19a0 into ppy:master Jan 30, 2024
3 checks passed
@notbakaneko notbakaneko deleted the fix-nominated-button-unresolved-issue-count branch January 31, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Issues on the beatmap discussion
2 participants