Start application in the right theme

Summary:
Changelog: Improved dark mode support!

This diff makes sure that the dark mode preference is written to the Flipper config, and applied during startup, so that the ugly light/dark flash when starting Flipper in dark mode disappears

Reviewed By: passy

Differential Revision: D29436059

fbshipit-source-id: 0f762149848298512026fbd216d9a9e0bf4276db
This commit is contained in:
Michel Weststrate
2021-06-29 08:38:33 -07:00
committed by Facebook GitHub Bot
parent 617f8a928c
commit 014e571f74
5 changed files with 32 additions and 4 deletions

View File

@@ -215,7 +215,7 @@ function init() {
// listen to settings and load the right theme
sideEffect(
store,
{name: 'loadTheme', fireImmediately: true, throttleMs: 500},
{name: 'loadTheme', fireImmediately: false, throttleMs: 500},
(state) => ({
dark: state.settingsState.darkMode,
}),