Skip to content

Commit

Permalink
fix: 186-cover-image (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
avitorio authored Feb 20, 2024
1 parent 890384b commit a509ad3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/khaki-coats-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'outstatic': minor
---

Fixes coverImage bug
11 changes: 6 additions & 5 deletions packages/outstatic/src/client/pages/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ export default function List({ collection }: ListProps) {
? document?.object?.text
: ''
)
delete data.content
delete data.coverImage

const listData = { ...data }
delete listData.coverImage

documents.push({
...(data as OstDocument),
author: data.author.name || '',
publishedAt: new Date(data.publishedAt).toLocaleDateString(
...(listData as OstDocument),
author: listData.author.name || '',
publishedAt: new Date(listData.publishedAt).toLocaleDateString(
'en-US',
options
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const renderItems = () => {
return component?.ref?.onKeyDown(props)
},
onExit: () => {
popup?.[0].destroy()
popup?.[0]?.destroy()
component?.destroy()
}
}
Expand Down

0 comments on commit a509ad3

Please sign in to comment.