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