修复404跳转bug

This commit is contained in:
tangly1024
2022-04-13 13:05:20 +08:00
parent b122bab41d
commit f1a29575bd
14 changed files with 78 additions and 37 deletions

View File

@@ -9,6 +9,12 @@ import { ArticleLock } from './components/ArticleLock'
export const LayoutSlug = props => {
const { post, lock, validPassword } = props
if (!post) {
return <LayoutBase
{...props}
showInfoCard={true}
/>
}
if (!lock && post?.blockMap?.block) {
post.content = Object.keys(post.blockMap.block)

View File

@@ -15,7 +15,7 @@ export const ArticleDetail = props => {
const { locale } = useGlobal()
const date = formatDate(
post?.date?.start_date || post.createdTime,
post?.date?.start_date || post?.createdTime,
locale.LOCALE
)
return <div id='container'>
@@ -48,7 +48,7 @@ export const ArticleDetail = props => {
</section>
{/* Notion文章主体 */}
<section id="notion-article" className="px-1 max-w-5xl">
{post.blockMap && (<NotionPage post={post} />)}
{post && (<NotionPage post={post} />)}
</section>
<section className="px-1 py-2 my-1 text-sm font-light overflow-auto text-gray-600 dark:text-gray-400">

View File

@@ -10,7 +10,6 @@ const Progress = ({ targetRef, showPercent = true }) => {
const [percent, changePercent] = useState(0)
const scrollListener = () => {
const target = currentRef || document.getElementById('container')
console.log(target)
if (target) {
const clientHeight = target.clientHeight
const scrollY = window.pageYOffset