fix: import models

This commit is contained in:
Timothy J. Baek 2024-05-29 14:05:46 -07:00
parent 5c6373e057
commit 2981caa34b

View File

@ -307,9 +307,15 @@
for (const model of savedModels) {
if (model?.info ?? false) {
await updateModelById(localStorage.token, model.id, model.info).catch((error) => {
return null;
});
if ($models.find((m) => m.id === model.id)) {
await updateModelById(localStorage.token, model.id, model.info).catch((error) => {
return null;
});
} else {
await addNewModel(localStorage.token, model.info).catch((error) => {
return null;
});
}
}
}