hi all,
I’m facing the currently issue: session.disconnect is not working on window event beforeunload. I’ve already tried using the openvidu tutorial code but still not working
useEffect(() => {
if (token) {
console.log(‘<<<마운트>>>’);
joinSession();
} else {
alert(‘로그인 후 이용 가능한 페이지입니다’);
navigate(‘/members/login’);
}
const handleBeforeUnload = () => {
leaveSession(studyTime, mySessionId);
};
window.addEventListener('beforeunload', handleBeforeUnload);
return () => {
console.log('언마운트');
window.removeEventListener('beforeunload', handleBeforeUnload);
};
}, );
please help me!!