From 6d719bbdb934f5c57847529198790b0cef970f06 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 11 Jun 2024 20:02:05 +0800 Subject: [PATCH] only show the popover when the information is ready --- src/hooks/useBasePopoverReactionList/index.ts | 2 ++ .../PopoverReactionList/BasePopoverReactionList.tsx | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks/useBasePopoverReactionList/index.ts b/src/hooks/useBasePopoverReactionList/index.ts index 87c9d23c6e35..90fadc85e785 100644 --- a/src/hooks/useBasePopoverReactionList/index.ts +++ b/src/hooks/useBasePopoverReactionList/index.ts @@ -22,6 +22,7 @@ export default function useBasePopoverReactionList({emojiName, emojiReactions, a emojiCodes: [], hasUserReacted: false, users: [], + isReady: false, }; } @@ -34,6 +35,7 @@ export default function useBasePopoverReactionList({emojiName, emojiReactions, a reactionCount, hasUserReacted, users, + isReady: true, }; } diff --git a/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.tsx b/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.tsx index 851569ec120d..f9ef4041ba38 100644 --- a/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.tsx +++ b/src/pages/home/report/ReactionList/PopoverReactionList/BasePopoverReactionList.tsx @@ -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 (