diff --git a/src/lib/components/layout/Navbar/Menu.svelte b/src/lib/components/layout/Navbar/Menu.svelte index a9012c3c6..000d5afcd 100644 --- a/src/lib/components/layout/Navbar/Menu.svelte +++ b/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); } diff --git a/src/lib/components/layout/Sidebar/ChatMenu.svelte b/src/lib/components/layout/Sidebar/ChatMenu.svelte index a6e8c63bc..0b97ec6e6 100644 --- a/src/lib/components/layout/Sidebar/ChatMenu.svelte +++ b/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); }