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

Clicking active filter/tag/source should reload it #1287

Closed
jtojnar opened this issue Nov 23, 2021 · 2 comments · Fixed by #1300
Closed

Clicking active filter/tag/source should reload it #1287

jtojnar opened this issue Nov 23, 2021 · 2 comments · Fixed by #1300
Labels
Milestone

Comments

@jtojnar
Copy link
Member

jtojnar commented Nov 23, 2021

As mentioned in the second point in https://selfoss.aditu.de/forum/index.php?id=1447, in 2.18, clicking the current active filter/tag/source in the navbar triggered a reload of the EntriesPage. Since we switched to react-router in 405a3ec, it no longer works because it is URL-driven and clicking the link does not change the URL.

@jtojnar jtojnar added this to the 2.19 milestone Nov 23, 2021
@jtojnar jtojnar added the ui label Nov 23, 2021
@deathbybandaid
Copy link

I just made the switch from 2.18 to 2.19 and this is definitely one of those features I'm missing. However the improvements to the code outweigh this tiny change that I have to reload the page by other means.

jtojnar added a commit that referenced this issue Jan 5, 2022
This is quite hacky – router does not re-render the route when clicking
on an already active link because its data is based on the document.location.
To bypass this, we need to pass an extra value in the location’s state object
that will let us know we should reload. And for similar reasons, it cannot
just be a boolean (or we would have to clear the state each time to be able
to tell when the value changes again) so we are back at increasing counters.

Unfortunately, that is not end of it since any navigation would clear
the state, triggering another reload so we also need to use another
counter that only increases when the counter in location state increases.

Fixes: #1287
@jtojnar jtojnar closed this as completed in 3e1104d Jan 5, 2022
@deathbybandaid
Copy link

Just grabbed 2.19-4fcf02f and this works perfectly!

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants