From 3379fef26e7fa1d0757831a0443d9b700edef258 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 22 Dec 2023 01:20:32 -0800 Subject: [PATCH] fix: duplicate modelfile issue --- src/routes/(app)/modelfiles/create/+page.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/(app)/modelfiles/create/+page.svelte b/src/routes/(app)/modelfiles/create/+page.svelte index 18dee2d3d..505ab02d8 100644 --- a/src/routes/(app)/modelfiles/create/+page.svelte +++ b/src/routes/(app)/modelfiles/create/+page.svelte @@ -93,7 +93,10 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, ''); }; const saveModelfile = async (modelfile) => { - await modelfiles.set([...$modelfiles, modelfile]); + await modelfiles.set([ + ...$modelfiles.filter((m) => m.tagName !== modelfile.tagName), + modelfile + ]); localStorage.setItem('modelfiles', JSON.stringify($modelfiles)); };