feat: added full indexeddb support

This commit is contained in:
Luke Hagar
2024-07-04 17:05:59 +00:00
parent 7f96b00b67
commit e23eae5f80
30 changed files with 979 additions and 796 deletions

View File

@@ -1,14 +1,17 @@
<script lang="ts">
import { newSpec } from '$lib/db';
import { db, setSpec, type APISpec } from '$lib/db';
import { db, loadSpec, type APISpec } from '$lib/db';
import type { CssClasses } from '@skeletonlabs/skeleton';
export let width: CssClasses = "w-full"
</script>
<button
class="btn variant-ghost-error"
class="btn variant-ghost-error {width}"
on:click={async () => {
if (confirm(`Are you sure you want to delete all saved specs?`)) {
db.apiSpecs.clear();
setSpec(newSpec);
loadSpec(structuredClone(newSpec));
}
}}
>