diff --git a/web/components/ui/Content/Content.tsx b/web/components/ui/Content/Content.tsx
index 0dccff395..9208d216e 100644
--- a/web/components/ui/Content/Content.tsx
+++ b/web/components/ui/Content/Content.tsx
@@ -95,15 +95,19 @@ const MobileContent = ({
socialHandles,
extraPageContent,
messages,
- chatDisplayName,
- chatUserId,
+ currentUser,
showChat,
}) => {
+ if (!currentUser) {
+ return null;
+ }
+ const { id, displayName } = currentUser;
+
const chatContent = showChat && (
@@ -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}
/>
) : (
diff --git a/web/components/ui/Sidebar/Sidebar.tsx b/web/components/ui/Sidebar/Sidebar.tsx
index 2d2a011c1..b255b3fc2 100644
--- a/web/components/ui/Sidebar/Sidebar.tsx
+++ b/web/components/ui/Sidebar/Sidebar.tsx
@@ -11,6 +11,10 @@ export const Sidebar: FC = () => {
const currentUser = useRecoilValue(currentUserAtom);
const messages = useRecoilValue(visibleChatMessagesSelector);
+ if (!currentUser) {
+ return null;
+ }
+
const { id, isModerator, displayName } = currentUser;
return (