@@ -13,7 +13,7 @@ import type { MarkdownToJSX } from '~/components/ui/markdown'
13
13
import { ClientOnly } from '~/components/common/ClientOnly'
14
14
import { PageDataHolder } from '~/components/common/PageHolder'
15
15
import { MdiClockOutline } from '~/components/icons/clock'
16
- import { useSetHeaderMetaInfo } from '~/components/layout/header/internal/ hooks'
16
+ import { useSetHeaderMetaInfo } from '~/components/layout/header/hooks'
17
17
import { FloatPopover } from '~/components/ui/float-popover'
18
18
import { Loading } from '~/components/ui/loading'
19
19
import { Markdown } from '~/components/ui/markdown'
@@ -22,7 +22,8 @@ import { NoteTopic } from '~/components/widgets/note/NoteTopic'
22
22
import { SubscribeBell } from '~/components/widgets/subscribe/SubscribeBell'
23
23
import { TocAside , TocAutoScroll } from '~/components/widgets/toc'
24
24
import { XLogInfoForNote , XLogSummaryForNote } from '~/components/widgets/xlog'
25
- import { useNoteByNidQuery , useNoteData } from '~/hooks/data/use-note'
25
+ import { useCurrentNoteData , useNoteByNidQuery } from '~/hooks/data/use-note'
26
+ import { noopArr } from '~/lib/noop'
26
27
import { MarkdownImageRecordProvider } from '~/providers/article/MarkdownImageRecordProvider'
27
28
import {
28
29
CurrentNoteIdProvider ,
@@ -39,8 +40,6 @@ import { NoteHideIfSecret } from '../../../components/widgets/note/NoteHideIfSec
39
40
import { NoteMetaBar } from '../../../components/widgets/note/NoteMetaBar'
40
41
import styles from './page.module.css'
41
42
42
- const noopArr = [ ] as Image [ ]
43
-
44
43
const PageImpl = ( ) => {
45
44
const { id } = useParams ( ) as { id : string }
46
45
const { data } = useNoteByNidQuery ( id )
@@ -108,7 +107,9 @@ const NotePage = memo(({ note }: { note: NoteModel }) => {
108
107
< NoteHideIfSecret >
109
108
< XLogSummaryForNote />
110
109
< WrappedElementProvider >
111
- < MarkdownImageRecordProvider images = { note . images || noopArr } >
110
+ < MarkdownImageRecordProvider
111
+ images = { note . images || ( noopArr as Image [ ] ) }
112
+ >
112
113
< Markdown
113
114
as = "main"
114
115
renderers = { MarkdownRenderers }
@@ -139,7 +140,7 @@ const NotePage = memo(({ note }: { note: NoteModel }) => {
139
140
} )
140
141
141
142
const NoteTitle = ( ) => {
142
- const note = useNoteData ( )
143
+ const note = useCurrentNoteData ( )
143
144
if ( ! note ) return null
144
145
const title = note . title
145
146
return (
@@ -150,7 +151,7 @@ const NoteTitle = () => {
150
151
}
151
152
152
153
const NoteDateMeta = ( ) => {
153
- const note = useNoteData ( )
154
+ const note = useCurrentNoteData ( )
154
155
if ( ! note ) return null
155
156
156
157
const dateFormat = dayjs ( note . created )
0 commit comments