mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-06 12:37:48 +00:00
Update +page.svelte
This commit is contained in:
@@ -5,10 +5,18 @@
|
|||||||
import SaveButton from '$lib/components/FileManagement/SaveButton.svelte';
|
import SaveButton from '$lib/components/FileManagement/SaveButton.svelte';
|
||||||
import SaveNewButton from '$lib/components/FileManagement/SaveNewButton.svelte';
|
import SaveNewButton from '$lib/components/FileManagement/SaveNewButton.svelte';
|
||||||
import Upload from '$lib/components/FileManagement/Upload.svelte';
|
import Upload from '$lib/components/FileManagement/Upload.svelte';
|
||||||
import { db, selectedSpec } from '$lib/db';
|
import { db, selectedSpec, setSpec } from '$lib/db';
|
||||||
import { liveQuery } from 'dexie';
|
import { liveQuery } from 'dexie';
|
||||||
|
|
||||||
let apiSpecs = liveQuery(() => db.apiSpecs.toArray());
|
let apiSpecs = liveQuery(() => db.apiSpecs.toArray());
|
||||||
|
|
||||||
|
let loaded = false;
|
||||||
|
apiSpecs.subscribe((specs) => {
|
||||||
|
if (loaded) return;
|
||||||
|
if (specs.length > 0) {
|
||||||
|
setSpec(specs[0]);
|
||||||
|
}
|
||||||
|
});
|
||||||
$: console.log($apiSpecs);
|
$: console.log($apiSpecs);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user