mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-06 20:47:46 +00:00
feat: added full indexeddb support
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user