fix(client_v2): filter interval reset on mount and untranslated modal labels - #8551
Closed
hoang-rio wants to merge 3 commits into
Closed
fix(client_v2): filter interval reset on mount and untranslated modal labels#8551hoang-rio wants to merge 3 commits into
hoang-rio wants to merge 3 commits into
Conversation
…l on mount The mount effect in FiltersConfig posted setFiltersConfig unconditionally, which could overwrite the backend interval (e.g. 1 hour) with the default 24 hours before getFilteringStatus resolved. Only post when the enabled toggle actually changes.
The radio options were built once at module load, freezing labels in English after a language switch. Rebuild them in a memo so intl resolves per current locale.
hoang-rio
force-pushed
the
fix/client_v2-filter-config
branch
from
August 13, 2026 05:55
c2d2ecf to
90aa237
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8550.
Purpose
Fixes two
client_v2bugs:Filter update interval reset to 24h —
Settings/FiltersConfigran anunconditional
createEffecton mount that postedsetFiltersConfigwith thedefault interval (24h) before
getFilteringStatus()had resolved, silentlyoverwriting a saved interval such as 1 hour on the backend. It now posts only
when the "Enabled" toggle actually changes.
Modal radio labels stuck in English —
FilterUpdateModalbuilt its radiooptions once at module load, freezing labels via
intl.getMessage()in theinitial (English) locale. After switching the UI to Vietnamese, title and
buttons translated but the interval radios stayed English ("Disabled" instead
of "Vô hiệu"). Options are now rebuilt in a memo so labels follow the current
locale.
Note: #2 is a code bug (labels not re-resolved on language switch), not a
localization content issue — the Vietnamese strings were already correct, so it
does not belong on CrowdIn.
How does the change achieve it
FiltersConfig.tsx— the config POST is gated behindcreateEffect(on(enabled, …, { defer: true })), so it only fires when theuser toggles the switch instead of on every mount.
FilterUpdateModal.tsx—RADIO_OPTIONSmoved from a module-level constantinto a
createMemoinside the component, making labels reactive tointl.changeLanguage().Tests
client_v2/src/__tests__/components/Settings/FiltersConfig.test.tsx— new:no POST on mount, no overwrite while status is loading, toggle still posts.
client_v2/src/__tests__/components/FilterLists/filter-update-modal.test.tsx—new: asserts "Vô hiệu" after
intl.changeLanguage('vi').npm run checkpasses (645 tests, lint, typecheck).