This commit is contained in:
Timothy Jaeryang Baek 2025-10-01 22:05:42 -05:00
parent 9677871ce7
commit af34e414e1
2 changed files with 6 additions and 1 deletions

View file

@ -508,6 +508,7 @@
const savedModelIds = async () => { const savedModelIds = async () => {
if ( if (
$selectedFolder && $selectedFolder &&
selectedModels.filter((modelId) => modelId !== '').length > 0 &&
JSON.stringify($selectedFolder?.data?.model_ids) !== JSON.stringify(selectedModels) JSON.stringify($selectedFolder?.data?.model_ids) !== JSON.stringify(selectedModels)
) { ) {
const res = await updateFolderById(localStorage.token, $selectedFolder.id, { const res = await updateFolderById(localStorage.token, $selectedFolder.id, {

View file

@ -39,9 +39,13 @@
}; };
$: if (selectedModels.length > 0 && $models.length > 0) { $: if (selectedModels.length > 0 && $models.length > 0) {
selectedModels = selectedModels.map((model) => const _selectedModels = selectedModels.map((model) =>
$models.map((m) => m.id).includes(model) ? model : '' $models.map((m) => m.id).includes(model) ? model : ''
); );
if (JSON.stringify(_selectedModels) !== JSON.stringify(selectedModels)) {
selectedModels = _selectedModels;
}
} }
</script> </script>