Skip to content

Commit

Permalink
only show the popover when the information is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Jun 11, 2024
1 parent 7e8985f commit 6d719bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 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 && !!reportActionID && !!emojiName}
isVisible={isPopoverVisible && isReady}
onClose={hideReactionList}
anchorPosition={popoverAnchorPosition}
animationIn="fadeIn"
Expand Down

0 comments on commit 6d719bb

Please sign in to comment.