forked from open-webui/open-webui
		
	feat: archive chat
This commit is contained in:
		
							parent
							
								
									00b01c973e
								
							
						
					
					
						commit
						fbd520bf07
					
				
					 5 changed files with 125 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -17,7 +17,8 @@
 | 
			
		|||
		getChatById,
 | 
			
		||||
		getChatListByTagName,
 | 
			
		||||
		updateChatById,
 | 
			
		||||
		getAllChatTags
 | 
			
		||||
		getAllChatTags,
 | 
			
		||||
		archiveChatById
 | 
			
		||||
	} from '$lib/apis/chats';
 | 
			
		||||
	import { toast } from 'svelte-sonner';
 | 
			
		||||
	import { fade, slide } from 'svelte/transition';
 | 
			
		||||
| 
						 | 
				
			
			@ -139,6 +140,11 @@
 | 
			
		|||
		localStorage.setItem('settings', JSON.stringify($settings));
 | 
			
		||||
		location.href = '/';
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	const archiveChatHandler = async (id) => {
 | 
			
		||||
		await archiveChatById(localStorage.token, id);
 | 
			
		||||
		await chats.set(await getChatList(localStorage.token));
 | 
			
		||||
	};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<ShareChatModal bind:show={showShareChatModal} chatId={shareChatId} />
 | 
			
		||||
| 
						 | 
				
			
			@ -594,7 +600,7 @@
 | 
			
		|||
											aria-label="Archive"
 | 
			
		||||
											class=" self-center dark:hover:text-white transition"
 | 
			
		||||
											on:click={() => {
 | 
			
		||||
												selectedChatId = chat.id;
 | 
			
		||||
												archiveChatHandler(chat.id);
 | 
			
		||||
											}}
 | 
			
		||||
										>
 | 
			
		||||
											<ArchiveBox />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue