mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
a7e86a322f
commit
92585edd1e
6 files changed
+46
-8
No files matched your search
@@ -24,11 +24,17 @@ async function handleMessage({ id, name, args }) {
|
||||
setTimeout(done, 0);
|
||||
}
|
||||
});
|
||||
if (name === "ofdgoExportDocument") {
|
||||
args.push((completed, total) => {
|
||||
self.postMessage({ id, type: "export", stage: "pages", completed, total });
|
||||
});
|
||||
}
|
||||
}
|
||||
const payload = await globalThis[name](...args);
|
||||
const result = typeof payload === "string" ? JSON.parse(payload) : payload;
|
||||
if (exporting && result.ok) {
|
||||
result.data.size = size;
|
||||
self.postMessage({ id, type: "export", stage: "save" });
|
||||
if (output) {
|
||||
await output.close();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user