@@ -200,11 +200,15 @@ export const Conversations: React.FC<ConversationsProps> = ({
200
200
! [ SidebarTabs . DIRECTS , SidebarTabs . GROUPS , SidebarTabs . FAVORITES ] . includes ( currentTab ) &&
201
201
groupParticipantsConversations . length > 0 ;
202
202
203
- const hasNoConversations = conversations . length + connectRequests . length === 0 ;
203
+ const showConnectionRequests = [ SidebarTabs . RECENT , SidebarTabs . DIRECTS ] . includes ( currentTab ) ;
204
+ const hasVisibleConnectionRequests = connectRequests . length > 0 && showConnectionRequests ;
205
+ const hasVisibleConversations = currentTabConversations . length > 0 ;
206
+ const hasNoVisbleConversations = ! hasVisibleConversations && ! hasVisibleConnectionRequests ;
207
+
204
208
const hasEmptyConversationsList =
205
209
! isGroupParticipantsVisible &&
206
- ( ( showSearchInput && currentTabConversations . length === 0 ) ||
207
- ( hasNoConversations && currentTab !== SidebarTabs . ARCHIVES ) ) ;
210
+ ( ( showSearchInput && hasNoVisbleConversations ) ||
211
+ ( hasNoVisbleConversations && currentTab !== SidebarTabs . ARCHIVES ) ) ;
208
212
209
213
const toggleSidebar = useCallback ( ( ) => {
210
214
if ( isFoldersTabOpen ) {
@@ -339,7 +343,7 @@ export const Conversations: React.FC<ConversationsProps> = ({
339
343
currentFolder = { currentFolder }
340
344
currentTab = { currentTab }
341
345
selfUser = { selfUser }
342
- showSearchInput = { ( showSearchInput && currentTabConversations . length !== 0 ) || ! ! conversationsFilter }
346
+ showSearchInput = { ( showSearchInput && hasVisibleConversations ) || ! ! conversationsFilter }
343
347
searchValue = { conversationsFilter }
344
348
setSearchValue = { onSearch }
345
349
searchInputPlaceholder = { searchInputPlaceholder }
@@ -424,7 +428,7 @@ export const Conversations: React.FC<ConversationsProps> = ({
424
428
callState = { callState }
425
429
currentFocus = { currentFocus }
426
430
listViewModel = { listViewModel }
427
- connectRequests = { connectRequests }
431
+ connectRequests = { showConnectionRequests ? connectRequests : [ ] }
428
432
handleArrowKeyDown = { handleKeyDown }
429
433
conversationState = { conversationState }
430
434
conversations = { currentTabConversations }
0 commit comments