Merge branch 'main' of https://github.com/john-david3/cs3305-team11
This commit is contained in:
@@ -61,6 +61,11 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ streamId }) => {
|
||||
setMessages((prev) => [...prev, data]);
|
||||
});
|
||||
|
||||
// Handle live viewership
|
||||
socket.on("status", (data: ChatMessage) => {
|
||||
console.log("Live viewership: ", data) // returns dictionary {message: message, num_viewers: num_viewers}
|
||||
})
|
||||
|
||||
// Cleanup function
|
||||
return () => {
|
||||
window.removeEventListener("beforeunload", handleBeforeUnload);
|
||||
|
||||
Reference in New Issue
Block a user