fix: apply theme and locale changes immediately on login screen (#5440) #5442
+8
−2
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.
Fix: Apply theme and locale changes immediately on login screen (#5440)
Description
This PR resolves the issue where theme and language settings were unresponsive on the login screen. The UI elements (theme toggle and language selector) now apply changes immediately upon selection.
Problem
Users were unable to change the Theme (Dark/Light mode) and Language settings on the login screen. Selecting a different language or toggling the theme did not update the interface. This issue occurred in v0.25.3 but not in the official demo.
Root Cause: The
ThemeSelectandLocaleSelectcomponents only called the parent callback (onValueChange/onChange) without applying the global state changes (loadTheme()/loadLocale()).Solution
Updated both components to apply global state changes synchronously while still notifying parent components:
Changes Made
1. ThemeSelect Component (
web/src/components/ThemeSelect.tsx)loadThemefrom@/utils/themehandleThemeChangeto callloadTheme()immediately before the parent callback2. LocaleSelect Component (
web/src/components/LocaleSelect.tsx)loadLocalefrom@/i18nhandleSelectChangeto callloadLocale()immediately before the parent callbackKey Changes