mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 18:01:22 +00:00
Initialize theme with default value at module load time
Prevents undefined theme when extensions call ctx.ui.custom() in edge cases where module resolution could cause the theme variable to be accessed before initTheme() is called.
This commit is contained in:
parent
a60cd42d40
commit
d18e44d378
2 changed files with 6 additions and 23 deletions
|
|
@ -593,8 +593,8 @@ function getDefaultTheme(): string {
|
|||
// Global Theme Instance
|
||||
// ============================================================================
|
||||
|
||||
export let theme: Theme;
|
||||
let currentThemeName: string | undefined;
|
||||
export let theme: Theme = loadTheme(getDefaultTheme());
|
||||
let currentThemeName: string | undefined = getDefaultTheme();
|
||||
let themeWatcher: fs.FSWatcher | undefined;
|
||||
let onThemeChangeCallback: (() => void) | undefined;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue