This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/master by this push:
new 4c9cac3 fix: switch color modes in multiple tabs (#902)
4c9cac3 is described below
commit 4c9cac3e8fcc7bfdfd570ea08ec98040050e68dd
Author: SkyeYoung <[email protected]>
AuthorDate: Fri Feb 25 21:03:04 2022 +0800
fix: switch color modes in multiple tabs (#902)
---
website/src/pages/index.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/website/src/pages/index.js b/website/src/pages/index.js
index 1711ef9..ba1525c 100644
--- a/website/src/pages/index.js
+++ b/website/src/pages/index.js
@@ -28,14 +28,14 @@ const useWindowSize = () => {
const ThemeResetComponent = () => {
const {isDarkTheme, setLightTheme, setDarkTheme} = useThemeContext();
- useEffect(() => {
+ useEffect(() => {
const children =
document.querySelector(".navbar__items--right").childElementCount;
document.querySelector(".navbar__items--right").childNodes[children-2].style.display
= "none";
if(isDarkTheme) {
setLightTheme(true);
- }
- }, [])
+ }
+ }, [isDarkTheme])
return (null);
};