diff --git a/src/components/email/use-file-preview.ts b/src/components/email/use-file-preview.ts index 0a9d9c2a..29a40b8b 100644 --- a/src/components/email/use-file-preview.ts +++ b/src/components/email/use-file-preview.ts @@ -224,6 +224,8 @@ export function useFilePreview(opts: { zipUnreadable: t('email_viewer.preview.archive_unreadable', "This archive can't be opened here."), }, colors.current); if (current()) setItem(next); + // Closed while the PDF was opening: end() ran before the document was. + else closePdfPages(local.uri); } catch (e) { if (!current()) return; close();