feat(dev): toast on successful theme-watch sync (#1316)

This commit is contained in:
Psychotoxical
2026-07-17 02:12:39 +02:00
committed by GitHub
parent 8610b2230e
commit 51b12eeec0
+11 -1
View File
@@ -8,6 +8,7 @@ import { gateInjectedThemes, syncInjectedThemes } from '@/lib/themes/themeInject
import { useThemeScheduler } from '@/app/hooks/useThemeScheduler';
import { useFontStore } from './store/fontStore';
import { getWindowKind } from './app/windowKind';
import { showToast } from '@/lib/dom/toast';
import MiniPlayerApp from './app/MiniPlayerApp';
import MainApp from './app/MainApp';
@@ -85,7 +86,16 @@ export default function App() {
installedAt: prev?.installedAt ?? Date.now(),
dev: prev ? prev.dev ?? false : true,
});
if (apply) useThemeStore.getState().setTheme(id);
if (apply) {
useThemeStore.getState().setTheme(id);
// Confirm the save reached the app — theme authors watch the app
// window, not the terminal. Main window only: the mini player
// subscribes too and would double the toast. Dev-only path, so the
// string stays untranslated (same as the rest of theme-watch).
if (getWindowKind() !== 'mini') {
showToast(`Theme synced: ${payload.name ?? prev?.name ?? id}`, 2500, 'success');
}
}
};
const subs = [
listen<WatchPayload>('theme-watch:css', ({ payload }) => install(payload, true)),