Skip to content

Commit

Permalink
fix: return undefined if no theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 29, 2024
1 parent 3798f4c commit 3cb3373
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,13 @@ export class Config implements IConfig {
await safeReadJson<Record<string, string>>(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,
}
}

Expand Down

0 comments on commit 3cb3373

Please sign in to comment.