Skip to content

Commit

Permalink
fix tag is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Aug 18, 2024
1 parent b910fe9 commit a1d846b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,13 @@ const Note = ({page,graphPath}:NoteProps) => {

<div className="flex flex-wrap gap-2">
{
page.properties?.tags?.map((tag:string)=>{
return <Tag key={tag} tag={tag}/>
})
Array.isArray(page.properties?.tags) && page.properties.tags.length > 0 ? (

Check failure on line 150 in src/Gallery.tsx

View workflow job for this annotation

GitHub Actions / release

'page.properties' is possibly 'undefined'.
page.properties.tags.map((tag: string) => (

Check failure on line 151 in src/Gallery.tsx

View workflow job for this annotation

GitHub Actions / release

'page.properties' is possibly 'undefined'.
<Tag key={tag} tag={tag} />
))
) : (
<div>无标签</div>
)
}
</div>
</div>
Expand Down

0 comments on commit a1d846b

Please sign in to comment.