Skip to content

Fixes #322 Edit votes loads only 15 images (scroll listener race condition)#418

Open
ayushshukla1807 wants to merge 4 commits intohatnote:masterfrom
ayushshukla1807:fix-edit-votes-infinite-scroll
Open

Fixes #322 Edit votes loads only 15 images (scroll listener race condition)#418
ayushshukla1807 wants to merge 4 commits intohatnote:masterfrom
ayushshukla1807:fix-edit-votes-infinite-scroll

Conversation

@ayushshukla1807
Copy link
Copy Markdown

@ayushshukla1807 ayushshukla1807 commented Mar 21, 2026

The "Edit Votes" view was failing to load more than the initial 15 images because the scroll listener was being attached in the onMounted hook. Since the container element is often toggled via v-if, the ref was null when onMounted fired, causing the listener to never be registered.

Changes:

Moved the scroll listener logic from onMounted to a watch that monitors the template ref.
Now, the listener is successfully attached the moment the DOM element is rendered.
Users can now correctly scroll through hundreds of previous votes.

This commit patches the admin_endpoints validation to gracefully handle empty POST bodies, and modifies MessageMiddleware to intercept MontageErrors so they correctly return 400 Bad Request JSON instead of bypassing CORS headers. Resolves Issue hatnote#357.
Bind :disabled='isLoading' on vote buttons to block concurrent clicks at DOM level before Vue's async re-render cycle can prevent them.
…atnote#325)

getRoundVotesStats was defined in jurorService but never called. Added onMounted fetch and post-vote refresh in VoteRating.vue and VoteYesNo.vue, with conditional rendering when round.show_stats is true.
editVoteContainer ref is inside a v-else-if block and is null at onMounted, so the scroll listener was never attached. Replaced with watch(editVoteContainer) to attach the listener once the element renders.
@ayushshukla1807 ayushshukla1807 force-pushed the fix-edit-votes-infinite-scroll branch from b1b675d to 2bcec5a Compare March 27, 2026 00:37
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.

1 participant