From 2d18d7f4571041d6e3391faa120f968257a8f7cb Mon Sep 17 00:00:00 2001 From: lencx Date: Thu, 25 May 2023 14:29:07 +0800 Subject: [PATCH] fix: export.js --- scripts/export.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/export.js b/scripts/export.js index 75390d4..130ad34 100644 --- a/scripts/export.js +++ b/scripts/export.js @@ -168,13 +168,13 @@ async function exportInit() { await invoke('download_list', { pathname: 'chat.notes.json', filename, id, dir: 'notes' }); } - async function downloadThread({ asF = Format.PNG } = {}) { + async function downloadThread({ as = Format.PNG } = {}) { const { startLoading, stopLoading } = new window.__LoadingMask('Exporting in progress...'); startLoading(); const elements = new Elements(); await elements.fixLocation(); const pixelRatio = window.devicePixelRatio; - const minRatio = asF === Format.PDF ? 2 : 2.5; + const minRatio = as === Format.PDF ? 2 : 2.5; window.devicePixelRatio = Math.max(pixelRatio, minRatio); html2canvas(elements.thread, { @@ -185,7 +185,7 @@ async function exportInit() { window.devicePixelRatio = pixelRatio; const imgData = canvas.toDataURL('image/png'); requestAnimationFrame(async () => { - if (asF === Format.PDF) { + if (as === Format.PDF) { await handlePdf(imgData, canvas, pixelRatio); } else { await handleImg(imgData);