From 2915230783f207fcdf055770cb113eb5b4519a46 Mon Sep 17 00:00:00 2001 From: Anu-Ujin Bat-Ulzii Date: Mon, 30 Oct 2023 18:13:56 +0800 Subject: [PATCH] fix(inbox): refetch conversation when assign --- .../containers/conversationDetail/DmWorkArea.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/plugin-inbox-ui/src/inbox/containers/conversationDetail/DmWorkArea.tsx b/packages/plugin-inbox-ui/src/inbox/containers/conversationDetail/DmWorkArea.tsx index 03e860fc86..d7124396cf 100644 --- a/packages/plugin-inbox-ui/src/inbox/containers/conversationDetail/DmWorkArea.tsx +++ b/packages/plugin-inbox-ui/src/inbox/containers/conversationDetail/DmWorkArea.tsx @@ -420,6 +420,12 @@ export const resetDmWithQueryCache = () => { }; const WithConsumer = (props: Props) => { + const [isInitial, setIsInitial] = React.useState(true); + + React.useEffect(() => { + setIsInitial(false); + }, [WithQuery]); + return ( {({ currentUser }) => { @@ -427,9 +433,9 @@ const WithConsumer = (props: Props) => { return null; } - // if (!WithQuery) { - WithQuery = generateWithQuery(props); - // } + if (isInitial) { + WithQuery = generateWithQuery(props); + } return ; }}