Message / Reactions: Fix flickering avatars in posts (#224)
This commit is contained in:
parent
24957c958e
commit
cd4047084f
@ -692,6 +692,7 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
availableReactions={availableReactions}
|
availableReactions={availableReactions}
|
||||||
genericEffects={genericEffects}
|
genericEffects={genericEffects}
|
||||||
observeIntersection={observeIntersectionForPlaying}
|
observeIntersection={observeIntersectionForPlaying}
|
||||||
|
noRecentReactors={isChannel}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -1149,6 +1150,7 @@ const Message: FC<OwnProps & StateProps> = ({
|
|||||||
availableReactions={availableReactions}
|
availableReactions={availableReactions}
|
||||||
genericEffects={genericEffects}
|
genericEffects={genericEffects}
|
||||||
observeIntersection={observeIntersectionForPlaying}
|
observeIntersection={observeIntersectionForPlaying}
|
||||||
|
noRecentReactors={isChannel}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -20,6 +20,7 @@ type OwnProps = {
|
|||||||
metaChildren?: React.ReactNode;
|
metaChildren?: React.ReactNode;
|
||||||
genericEffects?: ApiStickerSet;
|
genericEffects?: ApiStickerSet;
|
||||||
observeIntersection?: ObserveFn;
|
observeIntersection?: ObserveFn;
|
||||||
|
noRecentReactors?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const MAX_RECENT_AVATARS = 3;
|
const MAX_RECENT_AVATARS = 3;
|
||||||
@ -32,6 +33,7 @@ const Reactions: FC<OwnProps> = ({
|
|||||||
metaChildren,
|
metaChildren,
|
||||||
genericEffects,
|
genericEffects,
|
||||||
observeIntersection,
|
observeIntersection,
|
||||||
|
noRecentReactors,
|
||||||
}) => {
|
}) => {
|
||||||
const totalCount = useMemo(() => (
|
const totalCount = useMemo(() => (
|
||||||
message.reactions!.results.reduce((acc, reaction) => acc + reaction.count, 0)
|
message.reactions!.results.reduce((acc, reaction) => acc + reaction.count, 0)
|
||||||
@ -46,7 +48,7 @@ const Reactions: FC<OwnProps> = ({
|
|||||||
message={message}
|
message={message}
|
||||||
activeReactions={activeReactions}
|
activeReactions={activeReactions}
|
||||||
availableReactions={availableReactions}
|
availableReactions={availableReactions}
|
||||||
withRecentReactors={totalCount <= MAX_RECENT_AVATARS}
|
withRecentReactors={totalCount <= MAX_RECENT_AVATARS && !noRecentReactors}
|
||||||
genericEffects={genericEffects}
|
genericEffects={genericEffects}
|
||||||
observeIntersection={observeIntersection}
|
observeIntersection={observeIntersection}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user