Restore the loading state of the app. Closes #2195

This commit is contained in:
Gabe Kangas 2022-10-10 18:33:15 -07:00
parent 9b31ee11ac
commit 7967106fcc
No known key found for this signature in database
GPG key ID: 9A56337728BC81EA
2 changed files with 13 additions and 11 deletions

View file

@ -95,15 +95,19 @@ const MobileContent = ({
socialHandles, socialHandles,
extraPageContent, extraPageContent,
messages, messages,
chatDisplayName, currentUser,
chatUserId,
showChat, showChat,
}) => { }) => {
if (!currentUser) {
return null;
}
const { id, displayName } = currentUser;
const chatContent = showChat && ( const chatContent = showChat && (
<ChatContainer <ChatContainer
messages={messages} messages={messages}
usernameToHighlight={chatDisplayName} usernameToHighlight={displayName}
chatUserId={chatUserId} chatUserId={id}
isModerator={false} isModerator={false}
height="40vh" height="40vh"
/> />
@ -208,11 +212,6 @@ export const Content: FC = () => {
window.addEventListener('resize', checkIfMobile); window.addEventListener('resize', checkIfMobile);
}, []); }, []);
if (!currentUser) {
return null;
}
const { id: currentUserId, displayName } = currentUser;
const showChat = !chatDisabled && isChatAvailable && isChatVisible; const showChat = !chatDisabled && isChatAvailable && isChatVisible;
return ( return (
@ -274,8 +273,7 @@ export const Content: FC = () => {
socialHandles={socialHandles} socialHandles={socialHandles}
extraPageContent={extraPageContent} extraPageContent={extraPageContent}
messages={messages} messages={messages}
chatDisplayName={displayName} currentUser={currentUser}
chatUserId={currentUserId}
showChat={showChat} showChat={showChat}
/> />
) : ( ) : (

View file

@ -11,6 +11,10 @@ export const Sidebar: FC = () => {
const currentUser = useRecoilValue(currentUserAtom); const currentUser = useRecoilValue(currentUserAtom);
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector); const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
if (!currentUser) {
return null;
}
const { id, isModerator, displayName } = currentUser; const { id, isModerator, displayName } = currentUser;
return ( return (
<Sider className={styles.root} collapsedWidth={0} width={320}> <Sider className={styles.root} collapsedWidth={0} width={320}>