Skip to content

fix: replace router.reload with location.reload#435

Open
MuraariK13052008 wants to merge 1 commit intohatnote:masterfrom
MuraariK13052008:fix/bug-06-router-reload
Open

fix: replace router.reload with location.reload#435
MuraariK13052008 wants to merge 1 commit intohatnote:masterfrom
MuraariK13052008:fix/bug-06-router-reload

Conversation

@MuraariK13052008
Copy link
Copy Markdown

What this fixes

After deleting a round, the page never refreshed — the deleted round remained visible in the UI even though it had been removed from the database.

Root cause

Line 194 of RoundEdit.vue calls router.reload() after a successful round deletion. Vue Router does not have a reload() method — this throws TypeError: router.reload is not a function at runtime. Because the error was thrown inside a .then() callback, it was silently swallowed and the page never refreshed.

Fix

Changed router.reload()location.reload(), which is the correct browser API for a full page reload. This is consistent with the exact same pattern already used in RoundInfo.vue for activateRound() and pauseRound().

Files changed

  • frontend/src/components/Round/RoundEdit.vue

How to verify

  1. Open any campaign with at least one round
  2. Delete a round using the delete action
  3. Confirm the page now refreshes automatically and the deleted round no longer appears

Relates to: T415578

Vue Router does not provide reload(). Using
location.reload() to properly refresh the page.
@lgelauff
Copy link
Copy Markdown
Collaborator

Thanks for submitting. It looks like https://phabricator.wikimedia.org/T415578 if your own ubmrella task. Have you looked for issues on Github that this would be relevant to?

Copy link
Copy Markdown
Collaborator

@lgelauff lgelauff left a comment

Choose a reason for hiding this comment

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

Correct fix, verified locally — deleting a round now refreshes the page as expected.

One note: the PR references T415578 (the GSoC umbrella task) but not GitHub issue #379, which directly describes this bug. Please add "Fixes #379" to the PR description.

@lgelauff
Copy link
Copy Markdown
Collaborator

I'll leave to @mahmoud / @Jayprakash-SE if the reload is too blunt an instrument here, or that a solution closer to reloadCampaignState is better

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.

2 participants