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

View file

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