1
0
Fork 0

Fix media caption and index not synced

This commit is contained in:
Lim Chee Aun 2023-10-07 09:41:38 +08:00
parent 769a5cb099
commit 12d0e6aed8

View file

@ -876,6 +876,11 @@ function Status({
0,
isSizeLarge ? undefined : 4,
);
const showMultipleMediaCaptions =
mediaAttachments.length > 1 &&
displayedMediaAttachments.some(
(media) => !!media.description && !isMediaCaptionLong(media.description),
);
return (
<article
@ -1273,14 +1278,7 @@ function Status({
{!!mediaAttachments.length && (
<MultipleMediaFigure
lang={language}
enabled={
mediaAttachments.length > 1 &&
displayedMediaAttachments.some(
(media) =>
!!media.description &&
!isMediaCaptionLong(media.description),
)
}
enabled={showMultipleMediaCaptions}
captionChildren={() => {
return displayedMediaAttachments.map(
(media, i) =>
@ -1317,9 +1315,7 @@ function Status({
showCaption={mediaAttachments.length === 1}
lang={language}
altIndex={
mediaAttachments.length > 1 &&
!!media.description &&
i + 1
showMultipleMediaCaptions && !!media.description && i + 1
}
to={`/${instance}/s/${id}?${
withinContext ? 'media' : 'media-only'