fix(client): pressing "Open" on PDF preview also opens note

This commit is contained in:
Elian Doran 2025-09-15 18:55:56 +03:00
parent 0c9d1e91bb
commit c5dbaccea8
No known key found for this signature in database

View File

@ -257,7 +257,15 @@ function renderFile(entity: FNote | FAttachment, type: string, $renderedContent:
`); `);
$downloadButton.on("click", () => openService.downloadFileNote(entity.noteId)); $downloadButton.on("click", () => openService.downloadFileNote(entity.noteId));
$openButton.on("click", () => openService.openNoteExternally(entity.noteId, entity.mime)); $openButton.on("click", async (e) => {
const iconEl = $openButton.find("> .bx");
iconEl.removeClass("bx bx-link-external");
iconEl.addClass("bx bx-loader spin");
e.stopPropagation();
await openService.openNoteExternally(entity.noteId, entity.mime)
iconEl.removeClass("bx bx-loader spin");
iconEl.addClass("bx bx-link-external");
});
// open doesn't work for protected notes since it works through a browser which isn't in protected session // open doesn't work for protected notes since it works through a browser which isn't in protected session
$openButton.toggle(!entity.isProtected); $openButton.toggle(!entity.isProtected);