Timothy Jaeryang Baek 2 달 전
부모
커밋
4f5aba8be7
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/lib/components/layout/Navbar/Menu.svelte
  2. 2 1
      src/lib/components/layout/Sidebar/ChatMenu.svelte

+ 1 - 1
src/lib/components/layout/Navbar/Menu.svelte

@@ -96,7 +96,7 @@
 					heightLeft -= pageHeight;
 				}
 
-				pdf.save('document.pdf');
+				pdf.save(`chat-${chat.chat.title}.pdf`);
 			} catch (error) {
 				console.error('Error generating PDF', error);
 			}

+ 2 - 1
src/lib/components/layout/Sidebar/ChatMenu.svelte

@@ -79,6 +79,7 @@
 	};
 
 	const downloadPdf = async () => {
+		const chat = await getChatById(localStorage.token, chatId);
 		const containerElement = document.getElementById('messages-container');
 
 		if (containerElement) {
@@ -113,7 +114,7 @@
 					heightLeft -= pageHeight;
 				}
 
-				pdf.save('document.pdf');
+				pdf.save(`chat-${chat.chat.title}.pdf`);
 			} catch (error) {
 				console.error('Error generating PDF', error);
 			}