mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-20 15:09:40 +00:00
封装isBroswer()
This commit is contained in:
@@ -6,6 +6,7 @@ import * as ThemeMap from '@/themes'
|
||||
import React from 'react'
|
||||
import { idToUuid } from 'notion-utils'
|
||||
import { useRouter } from 'next/router'
|
||||
import { isBrowser } from '@/lib/utils'
|
||||
|
||||
/**
|
||||
* 根据notion的slug访问页面
|
||||
@@ -21,7 +22,7 @@ const Slug = props => {
|
||||
changeLoadingState(true)
|
||||
const router = useRouter()
|
||||
setTimeout(() => {
|
||||
if (typeof document !== 'undefined') {
|
||||
if (isBrowser()) {
|
||||
const article = document.getElementById('container')
|
||||
if (!article) {
|
||||
router.push('/404').then(() => {
|
||||
|
||||
Reference in New Issue
Block a user