修复主题切换问题

This commit is contained in:
tangly1024.com
2023-07-24 11:45:48 +08:00
parent 96f6463043
commit eacfb51a09

View File

@@ -72,7 +72,8 @@ export function GlobalContextProvider({ children }) {
const currentIndex = THEMES.indexOf(theme)
const newIndex = currentIndex < THEMES.length - 1 ? currentIndex + 1 : 0
const newTheme = THEMES[newIndex]
const query = { ...router.query, theme: newTheme }
const query = router.query
query.theme = newTheme
router.push({ pathname: router.pathname, query })
return newTheme
}