Explorar el Código

fix/refac: enforce multiple models permission to imported chats

Timothy Jaeryang Baek hace 4 meses
padre
commit
a47e3b429e
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      src/lib/components/chat/Chat.svelte

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

@@ -872,6 +872,11 @@
 					(chatContent?.models ?? undefined) !== undefined
 						? chatContent.models
 						: [chatContent.models ?? ''];
+
+				if (!($user?.role === 'admin' || ($user?.permissions?.chat?.multiple_models ?? true))) {
+					selectedModels = selectedModels.length > 0 ? [selectedModels[0]] : [''];
+				}
+
 				oldSelectedModelIds = selectedModels;
 
 				history =