fix leaving the room redirect afte whereby client-side fix

This commit is contained in:
Igor Loskutov
2025-06-19 12:23:41 -04:00
parent ff291a3ec8
commit ebcb0fcc7e

View File

@@ -197,14 +197,14 @@ export default function Room(details: RoomDetails) {
}, [isLoading, meeting?.error]); }, [isLoading, meeting?.error]);
useEffect(() => { useEffect(() => {
if (isLoading || !isAuthenticated || !roomUrl) return; if (isLoading || !isAuthenticated || !roomUrl || !wherebyLoaded) return;
wherebyRef.current?.addEventListener("leave", handleLeave); wherebyRef.current?.addEventListener("leave", handleLeave);
return () => { return () => {
wherebyRef.current?.removeEventListener("leave", handleLeave); wherebyRef.current?.removeEventListener("leave", handleLeave);
}; };
}, [handleLeave, roomUrl, isLoading, isAuthenticated]); }, [handleLeave, roomUrl, isLoading, isAuthenticated, wherebyLoaded]);
if (isLoading) { if (isLoading) {
return ( return (