From 3cb33734ff0a69e3d24f129ff210e8e52139002d Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 29 Jan 2024 13:53:52 -0700 Subject: [PATCH] fix: return undefined if no theme --- src/config/config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config/config.ts b/src/config/config.ts index ba701ac8e..fa005f84d 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -415,12 +415,13 @@ export class Config implements IConfig { await safeReadJson>(userThemeFile), ]) + // Merge the default theme with the user theme, giving the user theme precedence. + const merged = {...defaultTheme, ...userTheme} return { // Point to the user file if it exists, otherwise use the default file. // This doesn't really serve a purpose to anyone but removing it would be a breaking change. file: userTheme ? userThemeFile : defaultThemeFile, - // Merge the default theme with the user theme, giving the user theme precedence. - theme: parseTheme({...defaultTheme, ...userTheme}), + theme: Object.keys(merged).length > 0 ? parseTheme(merged) : undefined, } }