bito-code-review[bot] commented on PR #43778:
URL: https://github.com/apache/superset/pull/43778#issuecomment-5511948514
<!-- Bito Reply -->
The suggestion to update `this.systemMode` within `refreshSystemThemes()` is
correct and aligns with the goal of ensuring the live theme state remains
consistent with a full page reload. Since `refreshSystemThemes()` re-syncs the
theme slots and the media query listener, updating `this.systemMode` ensures
that subsequent calls to `handleSystemThemeChange` correctly detect OS
transitions, preventing the stale-value issue described.
**superset-frontend/src/theme/ThemeController.ts**
```
// Dark-theme availability may have changed (set or unset); re-sync the
// prefers-color-scheme listener so SYSTEM-mode OS switching stays
correct.
this.reconcileMediaQueryListener();
this.systemMode = ThemeController.getSystemPreferredMode();
// Recompute the mode exactly as the constructor would on a reload.
this.currentMode = this.determineInitialMode();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]