fix(desktop/print): proper reporting when it finishes

This commit is contained in:
Elian Doran
2025-10-19 20:50:18 +03:00
parent d1854d85ce
commit 3cf7e709fc
3 changed files with 65 additions and 47 deletions

View File

@@ -141,6 +141,13 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
doRender() {
this.$widget = $(TPL);
this.contentSized();
if (utils.isElectron()) {
const { ipcRenderer } = utils.dynamicRequire("electron");
ipcRenderer.on("print-done", () => {
toast.closePersistent("printing");
});
}
}
async refresh() {
@@ -330,6 +337,12 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
return;
}
toast.showPersistent({
icon: "bx bx-loader-circle bx-spin",
message: t("note_detail.printing_pdf"),
id: "printing"
});
const { ipcRenderer } = utils.dynamicRequire("electron");
ipcRenderer.send("export-as-pdf", {
title: this.note.title,