Browse Source

:art: export img

Vanessa 2 years ago
parent
commit
7237dcd43b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/src/protyle/export/util.ts

+ 4 - 1
app/src/protyle/export/util.ts

@@ -11,6 +11,7 @@ import {isMobile} from "../../util/functions";
 import {Constants} from "../../constants";
 import {highlightRender} from "../markdown/highlightRender";
 import {processRender} from "../util/processCode";
+import {openByMobile} from "../util/compatibility";
 
 declare const html2canvas: (element: Element) => Promise<any>;
 export const afterExport = (exportPath: string, msgId: string) => {
@@ -70,7 +71,9 @@ export const exportImage = (id: string) => {
                             const formData = new FormData();
                             formData.append("file", blob, response.data.name + ".png");
                             formData.append("type", "image/png");
-                            fetchPost("/api/export/exportAsFile", formData);
+                            fetchPost("/api/export/exportAsFile", formData, (response) => {
+                                openByMobile(response.data.file);
+                            });
                             hideMessage(msgId);
                             exportDialog.destroy();
                         });