feat: enhance theme management and image caching functionality
This commit is contained in:
@@ -8,15 +8,17 @@ class ThemeService {
|
||||
private _isDark: boolean = nativeTheme.shouldUseDarkColors;
|
||||
|
||||
constructor() {
|
||||
const themeMode = configManager.get(CONFIG_KEYS.THEME_MODE);
|
||||
if (themeMode) {
|
||||
nativeTheme.themeSource = themeMode;
|
||||
this._isDark = nativeTheme.shouldUseDarkColors;
|
||||
}
|
||||
this._setupIpcEvent();
|
||||
logManager.info('ThemeService initialized successfully.');
|
||||
}
|
||||
|
||||
async init() {
|
||||
const themeMode = configManager.get(CONFIG_KEYS.THEME_MODE);
|
||||
nativeTheme.themeSource = themeMode;
|
||||
this._isDark = nativeTheme.shouldUseDarkColors;
|
||||
logManager.info('ThemeService async init completed.');
|
||||
}
|
||||
|
||||
private _setupIpcEvent() {
|
||||
ipcMain.handle(IPC_EVENTS.SET_THEME_MODE, (_e, mode: ThemeMode) => {
|
||||
nativeTheme.themeSource = mode;
|
||||
@@ -25,7 +27,7 @@ class ThemeService {
|
||||
});
|
||||
|
||||
ipcMain.handle(IPC_EVENTS.GET_THEME_MODE, () => {
|
||||
return nativeTheme.themeSource;
|
||||
return configManager.get(CONFIG_KEYS.THEME_MODE);
|
||||
});
|
||||
|
||||
ipcMain.handle(IPC_EVENTS.IS_DARK_THEME, () => {
|
||||
|
||||
Reference in New Issue
Block a user