Skip to content

Commit

Permalink
fix: merge default and user theme
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jan 29, 2024
1 parent 5eaed66 commit 3798f4c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,16 +415,12 @@ export class Config implements IConfig {
await safeReadJson<Record<string, string>>(userThemeFile),
])

if (userTheme) {
return {
file: userThemeFile,
theme: parseTheme(userTheme),
}
}

return {
file: defaultThemeFile,
theme: parseTheme(defaultTheme ?? {}),
// 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}),
}
}

Expand Down

0 comments on commit 3798f4c

Please sign in to comment.