Commit 33b0df83 authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: fix empty thumbnail form section

parent 9b265817
Pipeline #199018 passed with stages
in 19 minutes and 4 seconds
...@@ -62,12 +62,13 @@ export function ThumbnailFormSection( ...@@ -62,12 +62,13 @@ export function ThumbnailFormSection(
<div>or</div> <div>or</div>
<FormField name={`${prefix}media`}> <FormField name={`${prefix}media`}>
{({ input: media }) => { {({ input: media }) => {
const images = const images = Array.isArray(media.value)
media.value?.filter( ? media.value.filter(
(m: { info?: MediaDetails }) => (m: { info?: MediaDetails }) =>
m.info?.category === 'image' && m.info?.category === 'image' &&
m.info.hasThumbnail === true, m.info.hasThumbnail === true,
) ?? [] )
: []
return ( return (
<Fragment> <Fragment>
<FormFieldAddButton <FormFieldAddButton
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment