mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🐛 Fix: dirty hack for Mermaid loading
This commit is contained in:
+25
-13
@@ -695,21 +695,33 @@ class FixIt {
|
||||
await loadMermaid();
|
||||
};
|
||||
|
||||
this.switchThemeEventSet.add(() => {
|
||||
if (processing) {
|
||||
console.warn('Mermaid is still processing, delaying the reload.');
|
||||
delayTask = reloadMermaid;
|
||||
return;
|
||||
}
|
||||
// console.log('reload immediately');
|
||||
reloadMermaid().catch(console.error);
|
||||
});
|
||||
const waitForMermaid = () => {
|
||||
return new Promise((resolve) => {
|
||||
const timer = setInterval(() => {
|
||||
if (window.mermaid && window.mermaid.initialize) {
|
||||
clearInterval(timer);
|
||||
resolve();
|
||||
}
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
this.beforeprintEventSet.add(() => {
|
||||
// Optionally set theme to 'neutral' for printing if required
|
||||
});
|
||||
waitForMermaid().then(() => {
|
||||
loadMermaid();
|
||||
this.switchThemeEventSet.add(() => {
|
||||
if (processing) {
|
||||
console.warn('Mermaid is still processing, delaying the reload.');
|
||||
delayTask = reloadMermaid;
|
||||
return;
|
||||
}
|
||||
// console.log('reload immediately');
|
||||
reloadMermaid().catch(console.error);
|
||||
});
|
||||
|
||||
loadMermaid();
|
||||
this.beforeprintEventSet.add(() => {
|
||||
// Optionally set theme to 'neutral' for printing if required
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
initEcharts() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v0.4.0-alpha-20250814015310-08d3c62b" -}}
|
||||
{{- hugo.Store.Set "version" "v0.4.0-alpha-20250814132913-e04bb611" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
Reference in New Issue
Block a user