Browse Source

Merge pull request #2115 from open-webui/dev

enhancement: youtu.be url support
Timothy Jaeryang Baek 11 tháng trước cách đây
mục cha
commit
78c2f16c3c

+ 5 - 1
src/lib/components/chat/MessageInput/Documents.svelte

@@ -143,7 +143,11 @@
 						</button>
 						</button>
 					{/each}
 					{/each}
 
 
-					{#if prompt.split(' ')?.at(0)?.substring(1).startsWith('https://www.youtube.com')}
+					{#if prompt
+						.split(' ')
+						.some((s) => s.substring(1).startsWith('https://www.youtube.com') || s
+									.substring(1)
+									.startsWith('https://youtu.be'))}
 						<button
 						<button
 							class="px-3 py-1.5 rounded-xl w-full text-left bg-gray-100 selected-command-option-button"
 							class="px-3 py-1.5 rounded-xl w-full text-left bg-gray-100 selected-command-option-button"
 							type="button"
 							type="button"