fix(ui): retry deferred markdown renderer setup
This commit is contained in:
committed by
Shantur Rathore
parent
de66b1349a
commit
5f144ca24d
@@ -13,7 +13,10 @@ let markdownModulePromise: Promise<MarkdownModule> | null = null
|
||||
|
||||
function loadMarkdownModule(): Promise<MarkdownModule> {
|
||||
if (!markdownModulePromise) {
|
||||
markdownModulePromise = import("../lib/markdown")
|
||||
markdownModulePromise = import("../lib/markdown").catch((error) => {
|
||||
markdownModulePromise = null
|
||||
throw error
|
||||
})
|
||||
}
|
||||
return markdownModulePromise
|
||||
}
|
||||
|
||||
@@ -61,7 +61,10 @@ async function getOrCreateHighlighter() {
|
||||
themes: ["github-light", "github-light-high-contrast", "github-dark"],
|
||||
langs: [],
|
||||
})
|
||||
})()
|
||||
})().catch((error) => {
|
||||
highlighterPromise = null
|
||||
throw error
|
||||
})
|
||||
|
||||
highlighter = await highlighterPromise
|
||||
highlighterPromise = null
|
||||
|
||||
Reference in New Issue
Block a user