WIP push-to-talk Letta chat frontend
1import { debounce } from "@std/async";
2import { saveWindowState, StateFlags } from "@tauri-apps/plugin-window-state";
3import { type Event, listen, TauriEvent } from "@tauri-apps/api/event";
4
5// Tauri doesn't have a Node.js server to do proper SSR
6// so we use adapter-static with a fallback to index.html to put the site in SPA mode
7// See: https://svelte.dev/docs/kit/single-page-apps
8// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
9export const ssr = false;
10
11const debounced = debounce((_: Event<TauriEvent.WINDOW_RESIZED>) => {
12 saveWindowState(StateFlags.ALL);
13}, 250);
14
15listen("tauri://resize", debounced);