Download tools/ui/src/lib/stores/init.ts from Parakon/parakon-runtime: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/Parakon/parakon-runtime/resolve/main/tools/ui/src/lib/stores/init.ts
- Command line
-
hf download hf://Parakon/parakon-runtime/tools/ui/src/lib/stores/init.ts
-
curl -L -o init.ts https://huggingface.co/Parakon/parakon-runtime/resolve/main/tools/ui/src/lib/stores/init.ts
1.12 kB
| // direct imports, not via the barrel, to avoid circular deps | |
| import { conversationsStore } from './conversations/index.svelte'; | |
| import { permissionsStore } from './permissions.svelte'; | |
| import { settingsStore } from './settings/index.svelte'; | |
| import { tabsStore } from './tabs.svelte'; | |
| import { toolsStore } from './tools.svelte'; | |
| import { versionStore } from './version.svelte'; | |
| import { browser } from '$app/environment'; | |
| import { MigrationService } from '$lib/services/migration.service'; | |
| let startup: Promise<void> | null = null; | |
| export function initStores(): Promise<void> { | |
| if (!browser) return Promise.resolve(); | |
| startup ??= (async () => { | |
| await MigrationService.runAllMigrations(); | |
| settingsStore.initialize(); | |
| permissionsStore.initialize(); | |
| toolsStore.initialize(); | |
| void versionStore.initialize(); | |
| // the full conversation list loads in the background; once it is back, | |
| // prune persisted tabs against the conversations that still exist | |
| void conversationsStore.initialize().then(() => { | |
| tabsStore.init(conversationsStore.conversations.map((c) => c.id)); | |
| }); | |
| })(); | |
| return startup; | |
| } | |