Generalized frontend model store (#193)

This commit is contained in:
Gregory Schier
2025-03-31 11:56:17 -07:00
committed by GitHub
parent ce885c3551
commit f1757ae427
201 changed files with 2185 additions and 2865 deletions

View File

@@ -1,7 +1,7 @@
// Listen for settings changes, the re-compute theme
import { listen } from '@tauri-apps/api/event';
import type { ModelPayload, Settings } from '@yaakapp-internal/models';
import { invokeCmd } from './lib/tauri';
import type { ModelPayload } from '@yaakapp-internal/models';
import { getSettings } from './lib/settings';
function setFontSizeOnDocument(fontSize: number) {
document.documentElement.style.fontSize = `${fontSize}px`;
@@ -12,6 +12,6 @@ listen<ModelPayload>('upserted_model', async (event) => {
setFontSizeOnDocument(event.payload.model.interfaceFontSize);
}).catch(console.error);
invokeCmd<Settings>('cmd_get_settings').then((settings) =>
getSettings().then((settings) =>
setFontSizeOnDocument(settings.interfaceFontSize),
);