forked from open-webui/open-webui
		
	fix: cleanup unused tags
This commit is contained in:
		
							parent
							
								
									7c1b8e396a
								
							
						
					
					
						commit
						1d937ec2f2
					
				
					 4 changed files with 37 additions and 6 deletions
				
			
		|  | @ -13,7 +13,8 @@ | |||
| 		getChatList, | ||||
| 		getChatById, | ||||
| 		getChatListByTagName, | ||||
| 		updateChatById | ||||
| 		updateChatById, | ||||
| 		getAllChatTags | ||||
| 	} from '$lib/apis/chats'; | ||||
| 	import toast from 'svelte-french-toast'; | ||||
| 	import { slide } from 'svelte/transition'; | ||||
|  | @ -330,7 +331,12 @@ | |||
| 						<button | ||||
| 							class="px-2.5 text-xs font-medium bg-gray-900 hover:bg-gray-800 transition rounded-full" | ||||
| 							on:click={async () => { | ||||
| 								await chats.set(await getChatListByTagName(localStorage.token, tag.name)); | ||||
| 								let chatIds = await getChatListByTagName(localStorage.token, tag.name); | ||||
| 								if (chatIds.length === 0) { | ||||
| 									await tags.set(await getAllChatTags(localStorage.token)); | ||||
| 									chatIds = await getChatList(localStorage.token); | ||||
| 								} | ||||
| 								await chats.set(chatIds); | ||||
| 							}} | ||||
| 						> | ||||
| 							{tag.name} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek