Browse Source

fix/refac: enforce multiple models permission to imported chats

Timothy Jaeryang Baek 4 months ago
parent
commit
a47e3b429e
1 changed files with 5 additions and 0 deletions
  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 =