Skip to content

Commit

Permalink
fix unreasonable room user information status
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterJack002 committed Nov 27, 2024
1 parent 24da6a6 commit 8b37003
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions webapp/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ export default function Layout(props: { meetingId: string }) {
setMeetingJoined(false)
}

useEffect(() => {
const cleanup = () => {
delStream(props.meetingId, localStreamId)
}
// Need to set separate Browser Events Parameters for Firefox refresh and browser termination
window.addEventListener('beforeunload', cleanup) // Used to monitor the browser termination of Firefox event
window.addEventListener('unload', cleanup) // Used to monitor Firefox refresh event
return () => {
window.removeEventListener('beforeunload', cleanup)
window.removeEventListener('unload', cleanup)
}
}, [props.meetingId, localStreamId])

//useEffect(() => {
// let shareScreenId = ""
// const setShareScreenId = (id: string) => shareScreenId = id
Expand Down

0 comments on commit 8b37003

Please sign in to comment.