mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-22 15:09:43 +00:00
重构优化主题异步加载
This commit is contained in:
@@ -33,6 +33,8 @@ export function GlobalContextProvider({ children }) {
|
||||
const handleBeforeUnload = (event) => {
|
||||
setOnReading(true)
|
||||
}
|
||||
// 监听页面元素加载完
|
||||
setOnReading(false)
|
||||
window.addEventListener('beforeunload', handleBeforeUnload)
|
||||
return () => {
|
||||
window.removeEventListener('beforeunload', handleBeforeUnload)
|
||||
|
||||
Reference in New Issue
Block a user