mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
1 parent
98d9effc8c
commit
affc84459e
9 files changed
+103
-37
No files matched your search
@@ -4085,8 +4085,18 @@ async function loadDocumentDetails(openSeq) {
|
||||
const info = await callWASM("ofdgoDocumentInfo", true);
|
||||
if (openSeq !== state.openSeq) return;
|
||||
if (!info.detailsPending) {
|
||||
const knownFonts = new Set((state.doc.fonts || []).map(font => font.id));
|
||||
const missingFonts = info.fonts?.some(font => font.used > 0 && font.status === "missing" && !knownFonts.has(font.id));
|
||||
Object.assign(state.doc, info, { detailsPending: false, detailsError: "" });
|
||||
renderMeta();
|
||||
if (missingFonts && fontManager.permission === "granted" && !state.editorInfo && !document.body.hasAttribute("aria-busy")) {
|
||||
setBusy(true);
|
||||
try {
|
||||
if (await autoLoadDocumentLocalFonts(openSeq) && openSeq === state.openSeq) await applyFontChange();
|
||||
} finally {
|
||||
if (openSeq === state.openSeq) setBusy(false);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user