Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}

@bernhardoj bernhardoj Jun 11, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that it's possible the other information isn't ready yet when the popover is visible, instead of checking each information one-by-one, I returned the isReady variable from getReactionInformation.

Screen.Recording.2024-06-11.at.19.53.03.mov

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