fix: release a PDF that finishes opening after its preview was closed

This commit is contained in:
Linus Rath
2026-10-16 19:42:04 +02:00
parent 9166b0fb3c
commit 323797b4ee
+2
View File
@@ -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();