fix: duplicate modelfile issue

This commit is contained in:
Timothy J. Baek 2023-12-22 01:20:32 -08:00
parent a25761a423
commit 3379fef26e

View file

@ -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));
};