Fix dark mode startup error
Summary: Changelog: Fixed startup error when loading default theme The theme defaulted to `auto`, instead of `system`, causing an startup exception. Fixed by adding types and having a more defensive startup check. Fixes https://github.com/facebook/flipper/issues/2835 Reviewed By: jknoxville Differential Revision: D30866648 fbshipit-source-id: 83b6d9fc235eaa0a7e959df4276d3f378eed7d1f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
80f48b444c
commit
f9c8bf8941
@@ -15,9 +15,9 @@
|
||||
global.electronRequire = window.require;
|
||||
</script>
|
||||
<script>
|
||||
// load correct theme
|
||||
// load correct theme (n.b. this doesn't handle system value specifically, will assume light in such cases)
|
||||
try {
|
||||
if (JSON.parse(window.process.env.CONFIG).darkMode) {
|
||||
if (JSON.parse(window.process.env.CONFIG).darkMode === 'dark') {
|
||||
document.getElementById('flipper-theme-import').href="themes/dark.css";
|
||||
} else {
|
||||
document.getElementById('flipper-theme-import').href="themes/light.css";
|
||||
|
||||
Reference in New Issue
Block a user