Fix startup error when loading theme

Summary: During testing, observed that Flipper always starts with an exception if `darkMode` is `true` or `false` (the old format) during startup, and this exception keeps on happening until the setting is changed. The root cause is that the setting is treated verbatim since D30666966 (9a4d94c971), trigger a very confusing Electron error. This diff addresses that.

Reviewed By: timur-valiev

Differential Revision: D30806453

fbshipit-source-id: fc7bbdda4e8bdf2dc4e3ca7ab1b05984c9406c68
This commit is contained in:
Michel Weststrate
2021-09-08 09:55:25 -07:00
committed by Facebook GitHub Bot
parent 3210f2fec4
commit e1e9ca0f52

View File

@@ -56,6 +56,12 @@ export default function setup(argv: any) {
// Non-persistent CLI arguments.
config = {
...config,
darkMode:
typeof config.darkMode === 'boolean'
? config.darkMode // normalise darkmode from old format
? 'dark'
: 'light'
: config.darkMode,
updaterEnabled: argv.updater,
launcherEnabled: argv.launcher,
launcherMsg: argv.launcherMsg,