From 48d6bb203cf5f6b02a96ee0d058e3fc65c603406 Mon Sep 17 00:00:00 2001 From: Evan Luo Date: Sat, 30 Sep 2023 21:20:01 -0400 Subject: [PATCH] lightdark: fix bug --- source/js/tools/lightDarkSwitch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/js/tools/lightDarkSwitch.js b/source/js/tools/lightDarkSwitch.js index 838c745e..8cf4038e 100755 --- a/source/js/tools/lightDarkSwitch.js +++ b/source/js/tools/lightDarkSwitch.js @@ -150,10 +150,12 @@ export const ModeToggle = { typeof theme.mermaid.style.dark !== "undefined" ? theme.mermaid.style.dark : "dark"; - await saveOriginalData().catch(console.error); this.initModeStatus(); this.initModeToggleButton(); this.initModeAutoTrigger(); + try { + await saveOriginalData().catch(console.error); + } catch (error) {} }, };