mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
Fix setTheme not triggering rerender, improve mac-system-theme example
This commit is contained in:
parent
e5e944475d
commit
37378fb346
3 changed files with 17 additions and 3 deletions
|
|
@ -621,6 +621,9 @@ export function setTheme(name: string, enableWatcher: boolean = false): { succes
|
|||
if (enableWatcher) {
|
||||
startThemeWatcher();
|
||||
}
|
||||
if (onThemeChangeCallback) {
|
||||
onThemeChangeCallback();
|
||||
}
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
// Theme is invalid - fall back to dark theme
|
||||
|
|
@ -638,6 +641,9 @@ export function setThemeInstance(themeInstance: Theme): void {
|
|||
theme = themeInstance;
|
||||
currentThemeName = "<in-memory>";
|
||||
stopThemeWatcher(); // Can't watch a direct instance
|
||||
if (onThemeChangeCallback) {
|
||||
onThemeChangeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
export function onThemeChange(callback: () => void): void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue