mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-25 01:08:50 +01:00
Fix media caption and index not synced
This commit is contained in:
parent
769a5cb099
commit
12d0e6aed8
1 changed files with 7 additions and 11 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue