Fix chat embeds not loading. Fixes #2744
This commit is contained in:
parent
5824113112
commit
1f99b0bf22
@ -10,21 +10,20 @@ import {
|
|||||||
export default function ReadOnlyChatEmbed() {
|
export default function ReadOnlyChatEmbed() {
|
||||||
const currentUser = useRecoilValue(currentUserAtom);
|
const currentUser = useRecoilValue(currentUserAtom);
|
||||||
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
|
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
|
||||||
if (!currentUser) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const { id, displayName } = currentUser;
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ClientConfigStore />
|
<ClientConfigStore />
|
||||||
<ChatContainer
|
{currentUser && (
|
||||||
messages={messages}
|
<ChatContainer
|
||||||
usernameToHighlight={displayName}
|
messages={messages}
|
||||||
chatUserId={id}
|
usernameToHighlight={currentUser.displayName}
|
||||||
isModerator={false}
|
chatUserId={currentUser.id}
|
||||||
showInput={false}
|
isModerator={false}
|
||||||
height="100vh"
|
showInput={false}
|
||||||
/>
|
height="100vh"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -26,25 +26,22 @@ export default function ReadWriteChatEmbed() {
|
|||||||
const { videoAvailable } = appState;
|
const { videoAvailable } = appState;
|
||||||
const { streamTitle, online } = clientStatus;
|
const { streamTitle, online } = clientStatus;
|
||||||
|
|
||||||
if (!currentUser) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const headerText = online ? streamTitle || name : name;
|
const headerText = online ? streamTitle || name : name;
|
||||||
|
|
||||||
const { id, displayName, isModerator } = currentUser;
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<ClientConfigStore />
|
<ClientConfigStore />
|
||||||
<Header name={headerText} chatAvailable chatDisabled={chatDisabled} online={videoAvailable} />
|
<Header name={headerText} chatAvailable chatDisabled={chatDisabled} online={videoAvailable} />
|
||||||
<ChatContainer
|
{currentUser && (
|
||||||
messages={messages}
|
<ChatContainer
|
||||||
usernameToHighlight={displayName}
|
messages={messages}
|
||||||
chatUserId={id}
|
usernameToHighlight={currentUser.displayName}
|
||||||
isModerator={isModerator}
|
chatUserId={currentUser.id}
|
||||||
showInput
|
isModerator={currentUser.isModerator}
|
||||||
height="80vh"
|
showInput
|
||||||
/>
|
height="80vh"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user