Only show moderator notification once. Closes #2578

This commit is contained in:
Gabe Kangas 2023-01-13 20:53:10 -08:00
parent 59b7f6dcbf
commit e48e274c79
No known key found for this signature in database
GPG Key ID: 4345B2060657F330

View File

@ -33,6 +33,7 @@ const SERVER_STATUS_POLL_DURATION = 5000;
const ACCESS_TOKEN_KEY = 'accessToken';
let serverStatusRefreshPoll: ReturnType<typeof setInterval>;
let hasBeenModeratorNotified = false;
// Server status is what gets updated such as viewer count, durations,
// stream title, online/offline state, etc.
@ -284,7 +285,10 @@ export const ClientConfigStore: FC = () => {
setChatAuthenticated,
setCurrentUser,
);
if (!hasBeenModeratorNotified) {
setChatMessages(currentState => [...currentState, message as ChatEvent]);
hasBeenModeratorNotified = true;
}
break;
case MessageType.CHAT:
setChatMessages(currentState => [...currentState, message as ChatEvent]);