Browse Source

:art: pdf

Vanessa 1 year ago
parent
commit
29270b4e88
1 changed files with 7 additions and 0 deletions
  1. 7 0
      app/src/protyle/export/index.ts

+ 7 - 0
app/src/protyle/export/index.ts

@@ -558,6 +558,13 @@ const renderPDF = async (id: string) => {
         });
         setPadding();
         renderPreview(response.data);
+        window.addEventListener("keydown", (event) => {
+            if (event.key === "Escape") {
+                const {ipcRenderer}  = require("electron");
+                ipcRenderer.send("${Constants.SIYUAN_CMD}", "destroy")
+                event.preventDefault();
+            }
+        })
     });
 </script></body></html>`;
     fetchPost("/api/export/exportTempContent", {content: html}, (response) => {