Timothy Jaeryang Baek 6 дней назад
Родитель
Сommit
af34e414e1

+ 1 - 0
src/lib/components/chat/Chat.svelte

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

+ 5 - 1
src/lib/components/chat/ModelSelector.svelte

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