Skip to content

Commit

Permalink
Merge pull request #43464 from bernhardoj/fix/43169-long-pressing-rea…
Browse files Browse the repository at this point in the history
…ction-list-doesnt-show-for-first-time

Fix long pressing the comment reaction does not open the reactions modal the first time you do it
  • Loading branch information
mountiny committed Jun 12, 2024
2 parents 033e74c + 6d719bb commit 82d0360
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/hooks/useBasePopoverReactionList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function useBasePopoverReactionList({emojiName, emojiReactions, a
emojiCodes: [],
hasUserReacted: false,
users: [],
isReady: false,
};
}

Expand All @@ -34,6 +35,7 @@ export default function useBasePopoverReactionList({emojiName, emojiReactions, a
reactionCount,
hasUserReacted,
users,
isReady: true,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ function BasePopoverReactionList(props: BasePopoverReactionListPropsWithLocalWit
preferredLocale,
});
// Get the reaction information
const {emojiCodes, reactionCount, hasUserReacted, users} = getReactionInformation();

const {emojiCodes, reactionCount, hasUserReacted, users, isReady} = getReactionInformation();
useImperativeHandle(ref, () => ({hideReactionList, showReactionList}));

return (
<PopoverWithMeasuredContent
isVisible={isPopoverVisible}
isVisible={isPopoverVisible && isReady}
onClose={hideReactionList}
anchorPosition={popoverAnchorPosition}
animationIn="fadeIn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ function PopoverReactionList(props: unknown, ref: ForwardedRef<ReactionListRef>)

useImperativeHandle(ref, () => ({showReactionList, hideReactionList, isActiveReportAction}));

if (reactionListReportActionID === '' || reactionListEmojiName === '') {
return null;
}

return (
<BasePopoverReactionList
ref={innerReactionListRef}
Expand Down

0 comments on commit 82d0360

Please sign in to comment.