Skip to content

Fixes #379#420

Open
ayushshukla1807 wants to merge 8 commits intohatnote:masterfrom
ayushshukla1807:fix/round-deletion-router-reload
Open

Fixes #379#420
ayushshukla1807 wants to merge 8 commits intohatnote:masterfrom
ayushshukla1807:fix/round-deletion-router-reload

Conversation

@ayushshukla1807
Copy link
Copy Markdown

@ayushshukla1807 ayushshukla1807 commented Mar 21, 2026

Summary

Fixes #379

router.reload() does not exist in Vue Router 4. When a round was successfully deleted via deleteRound() in RoundEdit.vue, the call to router.reload() silently threw an error, causing the UI to remain stale — the deleted round was still visible until the user manually refreshed the page.

Root Cause

useRouter() in Vue Router 4 returns an instance with methods like push(), replace(), go(), back(), and forward() — but not reload(). Calling router.reload() throws a TypeError at runtime, which is silently swallowed, so the round list never updates.

Fix

Replace router.reload() with router.go(0), which is the correct Vue Router 4 API for reloading the current route. It triggers a re-navigation to the current route via the history stack, refreshing the component state without triggering a full browser HTTP request (unlike window.location.reload()).

- router.reload()
+ router.go(0)

Why not window.location.reload()?

An existing PR #380 proposes using window.location.reload(). While this works, it triggers a full browser page refresh including re-fetching all assets. router.go(0) is the idiomatic Vue Router solution and is consistent with how navigation is handled elsewhere in this codebase.

Then click the "Create pull request" button or "Submit" button to submit the PR. After submitting, report back the PR URL.

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.
When a file has been reuploaded (oi_archive_name is set), use rec_img_timestamp and rec_img_text for upload_date and upload_user_text respectively — these reflect the original first upload, which is what competition eligibility checks (dq_by_upload_date, dq_by_uploader) should be based on.
router.reload() does not exist in Vue Router 4. After a round is
successfully deleted, the UI was not updating because calling an
undefined method threw a silent error. Replace with router.go(0),
which is the correct Vue Router 4 API for reloading the current route.

Fixes hatnote#379
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.

Invalid router.reload() in round deletion

1 participant