diff --git a/web/selectors/thread-selectors.js b/web/selectors/thread-selectors.js --- a/web/selectors/thread-selectors.js +++ b/web/selectors/thread-selectors.js @@ -107,9 +107,22 @@ ); } +function useDrawerSelectedThreadID(): ?string { + const activeChatThreadID = useSelector( + state => state.navInfo.activeChatThreadID, + ); + const pickedCommunityID = useSelector( + state => state.calendarPickedCommunityID, + ); + const inCalendar = useSelector(state => state.navInfo.tab === 'calendar'); + + return inCalendar ? pickedCommunityID : activeChatThreadID; +} + export { useOnClickThread, useThreadIsActive, useOnClickPendingSidebar, useOnClickNewThread, + useDrawerSelectedThreadID, };