mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-03 11:42:23 +01:00
fix(chat): export the complete conversation across PDF pages (#6921)
This commit is contained in:
+12
-1
@@ -561,10 +561,21 @@ function initializeEventListeners() {
|
||||
|
||||
// Export: PDF
|
||||
const exportPdfBtn = el('export-pdf-btn');
|
||||
let preparingPdf = false;
|
||||
if (exportPdfBtn) {
|
||||
exportPdfBtn.addEventListener('click', (e) => {
|
||||
exportPdfBtn.addEventListener('click', async (e) => {
|
||||
e.stopPropagation();
|
||||
exportMenu.classList.remove('open');
|
||||
if (preparingPdf) return;
|
||||
preparingPdf = true;
|
||||
try {
|
||||
await sessionModule.prepareHistoryForPrint();
|
||||
} catch (error) {
|
||||
uiModule.showError(error?.message || 'Could not prepare the chat for PDF export.');
|
||||
return;
|
||||
} finally {
|
||||
preparingPdf = false;
|
||||
}
|
||||
const meta = sessionModule.getSessions().find(s => s.id === sessionModule.getCurrentSessionId());
|
||||
const sessionName = meta ? meta.name : 'Odysseus Chat';
|
||||
const originalTitle = document.title;
|
||||
|
||||
Reference in New Issue
Block a user