Clean up model fetching and loading states

This commit is contained in:
Gregory Schier
2025-01-20 13:44:11 -08:00
parent 0453e84d38
commit 8ad7ac0bef
42 changed files with 180 additions and 247 deletions

View File

@@ -1,7 +1,7 @@
import { emit, listen } from '@tauri-apps/api/event';
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
import type { ModelPayload } from '@yaakapp-internal/models';
import { getSettings } from './lib/store';
import type { ModelPayload, Settings } from '@yaakapp-internal/models';
import { invokeCmd } from './lib/tauri';
import type { Appearance } from './lib/theme/appearance';
import { getCSSAppearance, subscribeToPreferredAppearance } from './lib/theme/appearance';
import { getResolvedTheme } from './lib/theme/themes';
@@ -32,7 +32,7 @@ listen<ModelPayload>('upserted_model', async (event) => {
}).catch(console.error);
async function configureTheme() {
const settings = await getSettings();
const settings = await invokeCmd<Settings>('cmd_get_settings');
const theme = getResolvedTheme(
preferredAppearance,
settings.appearance,