mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-25 09:18:51 +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,
|
0,
|
||||||
isSizeLarge ? undefined : 4,
|
isSizeLarge ? undefined : 4,
|
||||||
);
|
);
|
||||||
|
const showMultipleMediaCaptions =
|
||||||
|
mediaAttachments.length > 1 &&
|
||||||
|
displayedMediaAttachments.some(
|
||||||
|
(media) => !!media.description && !isMediaCaptionLong(media.description),
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article
|
<article
|
||||||
|
@ -1273,14 +1278,7 @@ function Status({
|
||||||
{!!mediaAttachments.length && (
|
{!!mediaAttachments.length && (
|
||||||
<MultipleMediaFigure
|
<MultipleMediaFigure
|
||||||
lang={language}
|
lang={language}
|
||||||
enabled={
|
enabled={showMultipleMediaCaptions}
|
||||||
mediaAttachments.length > 1 &&
|
|
||||||
displayedMediaAttachments.some(
|
|
||||||
(media) =>
|
|
||||||
!!media.description &&
|
|
||||||
!isMediaCaptionLong(media.description),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
captionChildren={() => {
|
captionChildren={() => {
|
||||||
return displayedMediaAttachments.map(
|
return displayedMediaAttachments.map(
|
||||||
(media, i) =>
|
(media, i) =>
|
||||||
|
@ -1317,9 +1315,7 @@ function Status({
|
||||||
showCaption={mediaAttachments.length === 1}
|
showCaption={mediaAttachments.length === 1}
|
||||||
lang={language}
|
lang={language}
|
||||||
altIndex={
|
altIndex={
|
||||||
mediaAttachments.length > 1 &&
|
showMultipleMediaCaptions && !!media.description && i + 1
|
||||||
!!media.description &&
|
|
||||||
i + 1
|
|
||||||
}
|
}
|
||||||
to={`/${instance}/s/${id}?${
|
to={`/${instance}/s/${id}?${
|
||||||
withinContext ? 'media' : 'media-only'
|
withinContext ? 'media' : 'media-only'
|
||||||
|
|
Loading…
Reference in a new issue