From 1e59a684a6997b93121c5e274bc7d722192be0ec Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Mon, 30 Dec 2024 11:32:33 +0800 Subject: [PATCH] :bug: Fix: giscus default theme maybe set error --- assets/js/theme.js | 9 +-------- layouts/partials/init/index.html | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/assets/js/theme.js b/assets/js/theme.js index 78f485b2..e32b9b1a 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -962,14 +962,7 @@ class FixIt { if ($script){ $script.parentElement.removeChild($script); } - const frame = document.querySelector('.giscus-frame'); - if (frame.getAttribute('loading') === 'lazy') { - frame.addEventListener('load', (e) => { - this._giscusOnSwitchTheme(); - }, { once: true }); - } else { - this._giscusOnSwitchTheme(); - } + this._giscusOnSwitchTheme() window.removeEventListener('message', this._messageListener, false); }; window.addEventListener('message', this._messageListener, false); diff --git a/layouts/partials/init/index.html b/layouts/partials/init/index.html index a29dda5c..8a53f4e2 100644 --- a/layouts/partials/init/index.html +++ b/layouts/partials/init/index.html @@ -1,4 +1,4 @@ -{{- .Scratch.Set "version" "v0.3.17-469af95f" -}} +{{- .Scratch.Set "version" "v0.3.17-30a67c4b" -}} {{- .Scratch.Set "this" dict -}} {{- partial "init/detection-env.html" . -}}