From 63479737a86f28a8220fbae018f0c1e7231f8d9d Mon Sep 17 00:00:00 2001 From: brecert Date: Fri, 17 Sep 2021 17:30:14 -0400 Subject: [PATCH] Fix trying to `in` undefined for themes --- src/context/Theme.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/context/Theme.tsx b/src/context/Theme.tsx index 347d1f01..8383b980 100644 --- a/src/context/Theme.tsx +++ b/src/context/Theme.tsx @@ -283,7 +283,8 @@ export function getBaseTheme(name: string): Theme { return PRESETS[name] } - const themes = getState().themes + // TODO: properly initialize `themes` in state instead of letting it be undefined + const themes = getState().themes ?? {} if (name in themes) { const { theme } = themes[name];