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 Territories selector updates without hard-reload #1619

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

aegroto
Copy link
Contributor

@aegroto aegroto commented Nov 20, 2024

Description

Territories (sub) selector fetches new data without the need to hard-reload. Fixes #914, but should prevent other missing updates as well

Additional Context

Nothing to declare

Checklist

Are your changes backwards compatible? Please answer below: Yes

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below: 8, nothing is broken

For frontend changes: Tested on mobile, light and dark mode? Please answer below: Yes

Did you introduce any new environment variables? If so, call them out explicitly here: No

@aegroto aegroto marked this pull request as draft November 20, 2024 11:39
@aegroto aegroto marked this pull request as ready for review November 20, 2024 13:17
@huumn
Copy link
Member

huumn commented Nov 20, 2024

Awesome. Can you explain why this change works and the previous code didn't?

Also, how did you reproduce and how did you test this change worked?

@aegroto
Copy link
Contributor Author

aegroto commented Nov 20, 2024

The previous version of the code didn't update along with settings because there wasn't any link between the data fetch in useSubs and the change in user's data (me). Therefore, even if the nsfwMode setting changed, nothing was triggering a refetch of subs. I have added an hook which fetches data everytime the nsfwMode setting changes.

To reproduce the issue, I have created a territory named 'a_nsfw_test_territory' tagged as nsfw. Here is a video showing how the select dropdown updates with my changes:

recording.mp4

@aegroto aegroto marked this pull request as draft November 20, 2024 15:09
@aegroto aegroto marked this pull request as ready for review November 20, 2024 15:11
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.

Territory list not refreshed if nsfw setting enabled
2 participants