From 544db4e617c62966c2dfc081340dedcc1be2e7cc Mon Sep 17 00:00:00 2001 From: zhengchun Date: Fri, 1 Dec 2023 21:52:40 +0800 Subject: [PATCH] fix theme switch --- assets/js/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/application.js b/assets/js/application.js index 5836f85..697f4a2 100644 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -88,7 +88,7 @@ } // home components preview const btnSwitchColorMode = document.querySelector(`input[name="btnColorMode"][value="${theme}"]`); - if (typeof btnSwitchColorMode === 'object') { + if (btnSwitchColorMode && typeof btnSwitchColorMode === 'object') { btnSwitchColorMode.checked = true; } };