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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user