Skip to content

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

Show moderation menu for moderators. Closes #1864

Gabe Kangasd435fd980826
diff --git a/web/components/chat/ChatContainer/ChatContainer.tsx b/web/components/chat/ChatContainer/ChatContainer.tsx
index 99e8650269..6e7e541981 100644
--- a/web/components/chat/ChatContainer/ChatContainer.tsx
+++ b/web/components/chat/ChatContainer/ChatContainer.tsx
@@ -17,15 +17,13 @@ import ChatJoinMessage from '../ChatJoinMessage/ChatJoinMessage';
interface Props {
messages: ChatMessage[];
- // loading: boolean;
usernameToHighlight: string;
chatUserId: string;
isModerator: boolean;
- isMobile: boolean | undefined;
}
export default function ChatContainer(props: Props) {
- const { messages, usernameToHighlight, chatUserId, isModerator, isMobile } = props;
+ const { messages, usernameToHighlight, chatUserId, isModerator } = props;
const [atBottom, setAtBottom] = useState(false);
// const [showButton, setShowButton] = useState(false);
@@ -146,7 +144,7 @@ export default function ChatContainer(props: Props) {
)}
</>
),
- [messages, usernameToHighlight, chatUserId, isModerator, atBottom, isMobile],
+ [messages, usernameToHighlight, chatUserId, isModerator, atBottom],
);
return (
diff --git a/web/components/chat/ChatModerationActionMenu/ChatModerationActionMenu.tsx b/web/components/chat/ChatModerationActionMenu/ChatModerationActionMenu.tsx
index 2de8d66fb6..11fb5e385f 100644
--- a/web/components/chat/ChatModerationActionMenu/ChatModerationActionMenu.tsx
+++ b/web/components/chat/ChatModerationActionMenu/ChatModerationActionMenu.tsx
@@ -12,7 +12,6 @@ import ChatModeration from '../../../services/moderation-service';
const { confirm } = Modal;
-/* eslint-disable @typescript-eslint/no-unused-vars */
interface Props {
accessToken: string;
messageID: string;
diff --git a/web/components/stores/ClientConfigStore.tsx b/web/components/stores/ClientConfigStore.tsx
index db5cb1f7fa..695c0b3899 100644
--- a/web/components/stores/ClientConfigStore.tsx
+++ b/web/components/stores/ClientConfigStore.tsx
@@ -339,8 +339,8 @@ export function ClientConfigStore() {
const metadata = mergeMeta(state.meta) as AppStateOptions;
- console.debug('--- APP STATE: ', state.value);
- console.debug('--- APP META: ', metadata);
+ // console.debug('--- APP STATE: ', state.value);
+ // console.debug('--- APP META: ', metadata);
setAppState(metadata);
});
diff --git a/web/components/stores/eventhandlers/connected-client-info-handler.ts b/web/components/stores/eventhandlers/connected-client-info-handler.ts
index 63dbea6edc..b10c137792 100644
--- a/web/components/stores/eventhandlers/connected-client-info-handler.ts
+++ b/web/components/stores/eventhandlers/connected-client-info-handler.ts
@@ -13,6 +13,6 @@ export default function handleConnectedClientInfoMessage(
setChatDisplayName(displayName);
setChatDisplayColor(displayColor);
setChatUserId(id);
- setIsChatModerator(scopes?.includes('moderator'));
+ setIsChatModerator(scopes?.includes('MODERATOR'));
setChatAuthenticated(authenticated);
}
diff --git a/web/components/ui/Content/Content.tsx b/web/components/ui/Content/Content.tsx
index fc4b7fe1e6..e436a3e7ed 100644
--- a/web/components/ui/Content/Content.tsx
+++ b/web/components/ui/Content/Content.tsx
@@ -172,7 +172,6 @@ export default function ContentComponent() {
usernameToHighlight={chatDisplayName}
chatUserId={chatUserId}
isModerator={false}
- isMobile={isMobile}
/>
</div>
</div>
diff --git a/web/components/ui/Sidebar/Sidebar.tsx b/web/components/ui/Sidebar/Sidebar.tsx
index b0d6811c99..0cc081a183 100644
--- a/web/components/ui/Sidebar/Sidebar.tsx
+++ b/web/components/ui/Sidebar/Sidebar.tsx
@@ -8,12 +8,14 @@ import {
chatMessagesAtom,
chatDisplayNameAtom,
chatUserIdAtom,
+ isChatModeratorAtom,
} from '../../stores/ClientConfigStore';
export default function Sidebar() {
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom);
const chatDisplayName = useRecoilValue<string>(chatDisplayNameAtom);
const chatUserId = useRecoilValue<string>(chatUserIdAtom);
+ const isChatModerator = useRecoilValue<boolean>(isChatModeratorAtom);
return (
<Sider className={s.root} collapsedWidth={0} width={320}>
@@ -21,8 +23,7 @@ export default function Sidebar() {
messages={messages}
usernameToHighlight={chatDisplayName}
chatUserId={chatUserId}
- isModerator={false}
- isMobile={false}
+ isModerator={isChatModerator}
/>
</Sider>
);
diff --git a/web/stories/ChatContainer.stories.tsx b/web/stories/ChatContainer.stories.tsx
index fae82b5a57..ca7e947e26 100644
--- a/web/stories/ChatContainer.stories.tsx
+++ b/web/stories/ChatContainer.stories.tsx
@@ -38,7 +38,6 @@ const AddMessagesChatExample = args => {
usernameToHighlight="testuser"
chatUserId="testuser"
isModerator={false}
- isMobile={false}
/>
</RecoilRoot>
);