Merge pull request #1324 from tangly1024/fix/theme-switch

修复主题切换问题
This commit is contained in:
tangly1024
2023-07-24 11:46:17 +08:00
committed by GitHub

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
}