Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix chat embeds not loading. Fixes #2744

Gabe Kangascfcbe0910ee6
diff --git a/web/pages/embed/chat/readonly/index.tsx b/web/pages/embed/chat/readonly/index.tsx
index bfd263d99d..65600c2942 100644
--- a/web/pages/embed/chat/readonly/index.tsx
+++ b/web/pages/embed/chat/readonly/index.tsx
@@ -10,21 +10,20 @@ import {
export default function ReadOnlyChatEmbed() {
const currentUser = useRecoilValue(currentUserAtom);
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
- if (!currentUser) {
- return null;
- }
- const { id, displayName } = currentUser;
+
return (
<div>
<ClientConfigStore />
- <ChatContainer
- messages={messages}
- usernameToHighlight={displayName}
- chatUserId={id}
- isModerator={false}
- showInput={false}
- height="100vh"
- />
+ {currentUser && (
+ <ChatContainer
+ messages={messages}
+ usernameToHighlight={currentUser.displayName}
+ chatUserId={currentUser.id}
+ isModerator={false}
+ showInput={false}
+ height="100vh"
+ />
+ )}
</div>
);
}
diff --git a/web/pages/embed/chat/readwrite/index.tsx b/web/pages/embed/chat/readwrite/index.tsx
index 0a6d2a73e6..1e0f85aee1 100644
--- a/web/pages/embed/chat/readwrite/index.tsx
+++ b/web/pages/embed/chat/readwrite/index.tsx
@@ -26,25 +26,22 @@ export default function ReadWriteChatEmbed() {
const { videoAvailable } = appState;
const { streamTitle, online } = clientStatus;
- if (!currentUser) {
- return null;
- }
-
const headerText = online ? streamTitle || name : name;
- const { id, displayName, isModerator } = currentUser;
return (
<div>
<ClientConfigStore />
<Header name={headerText} chatAvailable chatDisabled={chatDisabled} online={videoAvailable} />
- <ChatContainer
- messages={messages}
- usernameToHighlight={displayName}
- chatUserId={id}
- isModerator={isModerator}
- showInput
- height="80vh"
- />
+ {currentUser && (
+ <ChatContainer
+ messages={messages}
+ usernameToHighlight={currentUser.displayName}
+ chatUserId={currentUser.id}
+ isModerator={currentUser.isModerator}
+ showInput
+ height="80vh"
+ />
+ )}
</div>
);
}