diff --git a/package.json b/package.json index 1a3c0fe0..7a606f34 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@testing-library/svelte": "3.2.1", "@types/mermaid": "8.2.9", "@types/pako": "1.0.3", + "@types/uuid": "^8.3.4", "@typescript-eslint/eslint-plugin": "5.34.0", "@typescript-eslint/parser": "5.34.0", "@vitest/ui": "0.22.1", @@ -75,7 +76,8 @@ "monaco-mermaid": "1.0.6", "pako": "2.0.4", "random-word-slugs": "0.1.6", - "svg-pan-zoom": "^3.6.1" + "svg-pan-zoom": "^3.6.1", + "uuid": "^8.3.2" }, "lint-staged": { "*.{ts,svelte,js,css,md,json}": [ diff --git a/src/lib/components/history/history.svelte b/src/lib/components/history/history.svelte index 3e434fa9..525fa3e6 100644 --- a/src/lib/components/history/history.svelte +++ b/src/lib/components/history/history.svelte @@ -77,11 +77,11 @@ } }; - const clearHistory = (date?: number): void => { - if (!date && !prompt('Clear all saved items?')) { + const clearHistory = (id?: string): void => { + if (!id && !prompt('Clear all saved items?')) { return; } - clearHistoryData(date); + clearHistoryData(id); }; const restoreHistoryItem = (state: State): void => { @@ -147,7 +147,7 @@