Skip to content

Commit

Permalink
open a chat only if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
budnik9 committed Nov 29, 2023
1 parent 5a0d784 commit 392bc5a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/commonFeed/components/FeedLayout/FeedLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,13 @@ const FeedLayout: ForwardRefRenderFunction<FeedLayoutRef, FeedLayoutProps> = (
}, [batchNumber]);

useEffect(() => {
if (sharedFeedItemId && isTabletView && allFeedItems) {
if (
isTabletView &&
sharedFeedItemId &&
allFeedItems.length > 0 &&
allFeedItems.some((item) => item.itemId === sharedFeedItemId)
) {
deleteQueryParam(QueryParamKey.Item, true);
setActiveChatItem({ feedItemId: sharedFeedItemId });
}
}, [sharedFeedItemId, isTabletView, allFeedItems]);
Expand Down

0 comments on commit 392bc5a

Please sign in to comment.