Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

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(
<div>or</div>
<FormField name={`${prefix}media`}>
{({ input: media }) => {
const images =
media.value?.filter(
(m: { info?: MediaDetails }) =>
m.info?.category === 'image' &&
m.info.hasThumbnail === true,
) ?? []
const images = Array.isArray(media.value)
? media.value.filter(
(m: { info?: MediaDetails }) =>
m.info?.category === 'image' &&
m.info.hasThumbnail === true,
)
: []
return (
<Fragment>
<FormFieldAddButton
......
Markdown is supported
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