mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-30 15:10:11 +00:00
commerce
This commit is contained in:
@@ -48,7 +48,7 @@ export const siteConfig = (key) => {
|
||||
if (!val) {
|
||||
val = BLOG[key]
|
||||
}
|
||||
// console.log('实际配置', key, val)
|
||||
console.log('实际配置', key, val)
|
||||
return val
|
||||
}
|
||||
|
||||
|
||||
@@ -59,10 +59,6 @@ export function GlobalContextProvider(props) {
|
||||
initLocale(lang, locale, updateLang, updateLocale)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
checkThemeDOM()
|
||||
})
|
||||
|
||||
// 加载进度条
|
||||
useEffect(() => {
|
||||
const handleStart = (url) => {
|
||||
@@ -113,18 +109,4 @@ export function GlobalContextProvider(props) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换主题时的特殊处理
|
||||
*/
|
||||
const checkThemeDOM = () => {
|
||||
const elements = document.querySelectorAll('[id^="theme-"]')
|
||||
if (elements?.length > 1) {
|
||||
elements[elements.length - 1].scrollIntoView()
|
||||
// 删除前面的元素,只保留最后一个元素
|
||||
for (let i = 0; i < elements.length - 1; i++) {
|
||||
elements[i].parentNode.removeChild(elements[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const useGlobal = () => useContext(GlobalContext)
|
||||
|
||||
Reference in New Issue
Block a user