mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-06 15:49:44 +02:00
fix: lazy load diagrams in initThrowsErrorsAsync
Previously, calling initThrowsErrorsAsync would not
load any of the lazyLoadedDiagrams entries.
Adaptated from reverted commit 4601c90904
This commit is contained in:
@@ -49,7 +49,6 @@ const init = async function (
|
|||||||
try {
|
try {
|
||||||
const conf = mermaidAPI.getConfig();
|
const conf = mermaidAPI.getConfig();
|
||||||
if (conf?.lazyLoadedDiagrams && conf.lazyLoadedDiagrams.length > 0) {
|
if (conf?.lazyLoadedDiagrams && conf.lazyLoadedDiagrams.length > 0) {
|
||||||
await registerLazyLoadedDiagrams(conf);
|
|
||||||
await initThrowsErrorsAsync(config, nodes, callback);
|
await initThrowsErrorsAsync(config, nodes, callback);
|
||||||
} else {
|
} else {
|
||||||
initThrowsErrors(config, nodes, callback);
|
initThrowsErrors(config, nodes, callback);
|
||||||
@@ -229,6 +228,9 @@ const initThrowsErrorsAsync = async function (
|
|||||||
callback?: Function
|
callback?: Function
|
||||||
) {
|
) {
|
||||||
const conf = mermaidAPI.getConfig();
|
const conf = mermaidAPI.getConfig();
|
||||||
|
|
||||||
|
await registerLazyLoadedDiagrams(conf);
|
||||||
|
|
||||||
if (config) {
|
if (config) {
|
||||||
// This is a legacy way of setting config. It is not documented and should be removed in the future.
|
// This is a legacy way of setting config. It is not documented and should be removed in the future.
|
||||||
// @ts-ignore: TODO Fix ts errors
|
// @ts-ignore: TODO Fix ts errors
|
||||||
|
Reference in New Issue
Block a user