Remove repetitive check

This commit is contained in:
Gigiaj 2025-05-24 19:30:53 -05:00
parent 8b22573e43
commit 3818671446

View file

@ -226,8 +226,11 @@ export function RoomNavItem({
const unread = useRoomUnread(room.roomId, roomToUnreadAtom); const unread = useRoomUnread(room.roomId, roomToUnreadAtom);
const { const {
activeCallRoomId, activeCallRoomId,
viewedCallRoomId,
setActiveCallRoomId, setActiveCallRoomId,
setViewedCallRoomId, setViewedCallRoomId,
registerViewedClientWidgetApi,
viewedClientWidgetApi,
isChatOpen, isChatOpen,
toggleChat, toggleChat,
hangUp, hangUp,
@ -266,10 +269,9 @@ export function RoomNavItem({
if (!isMobile) { if (!isMobile) {
if (activeCallRoomId !== room.roomId) { if (activeCallRoomId !== room.roomId) {
hangUp(); hangUp();
if (viewedCallRoomId === activeCallRoomId) setViewedCallRoomId(room.roomId);
setActiveCallRoomId(room.roomId); setActiveCallRoomId(room.roomId);
if (mx.getRoom(viewedRoomId)?.isCallRoom()) { navigateRoom(room.roomId);
navigateRoom(room.roomId);
}
} else { } else {
navigateRoom(room.roomId); navigateRoom(room.roomId);
} }