chore(client/print): address requested changes

This commit is contained in:
Elian Doran
2025-10-20 14:04:04 +03:00
parent acae069b9e
commit 04f6777627
4 changed files with 20 additions and 8 deletions

View File

@@ -322,7 +322,12 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
iframe.className = "print-iframe";
document.body.appendChild(iframe);
iframe.onload = () => {
if (!iframe.contentWindow) return;
if (!iframe.contentWindow) {
toast.closePersistent("printing");
document.body.removeChild(iframe);
return;
}
iframe.contentWindow.addEventListener("note-ready", () => {
toast.closePersistent("printing");
iframe.contentWindow?.print();