Rollback listeners

This commit is contained in:
jim3692 2023-03-22 19:26:28 +02:00
parent f0f81cc499
commit 2d25d0f916
2 changed files with 8 additions and 2 deletions

View file

@ -45,7 +45,10 @@ function JitsiRoom(props) {
}
};
navigation.once(cons.events.navigation.ROOM_SELECTED, handleRoomSelected);
navigation.on(cons.events.navigation.ROOM_SELECTED, handleRoomSelected);
return () => {
navigation.removeListener(cons.events.navigation.ROOM_SELECTED, handleRoomSelected);
};
}, [mx, roomInfo]);
useEffect(() => {

View file

@ -41,7 +41,10 @@ function Room(props) {
}
};
navigation.once(cons.events.navigation.ROOM_SELECTED, handleRoomSelected);
navigation.on(cons.events.navigation.ROOM_SELECTED, handleRoomSelected);
return () => {
navigation.removeListener(cons.events.navigation.ROOM_SELECTED, handleRoomSelected);
};
}, [roomInfo]);
useEffect(() => {