From 641bf1268d6ae2144780a122036b07fef55f7581 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 23 Sep 2022 09:24:20 -0400 Subject: [PATCH] Fix loading state for chat-list --- .../features/chats/components/chat-pane/chat-pane.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx b/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx index 9ab8252e0..f1ceec98f 100644 --- a/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx +++ b/app/soapbox/features/chats/components/chat-pane/chat-pane.tsx @@ -24,7 +24,7 @@ const ChatPane = () => { const debouncedValue = debounce(value as string, 300); const { chat, setChat, isOpen, isSearching, setSearching, toggleChatPane } = useChatContext(); - const { chatsQuery: { data: chats } } = useChats(debouncedValue); + const { chatsQuery: { data: chats, isLoading } } = useChats(debouncedValue); const unreadCount = sumBy(chats, (chat) => chat.unread); @@ -42,7 +42,7 @@ const ChatPane = () => { }; const renderBody = () => { - if (hasSearchValue || Number(chats?.length) > 0) { + if (hasSearchValue || Number(chats?.length) > 0 || isLoading) { return ( {features.chatsSearch && ( @@ -55,7 +55,7 @@ const ChatPane = () => { )} - {Number(chats?.length) > 0 ? ( + {(Number(chats?.length) > 0 || isLoading) ? (