mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-13 10:40:28 +03:00
Show call room even if category is collapsed
This commit is contained in:
parent
efc77ceb44
commit
f407905d73
1 changed files with 7 additions and 2 deletions
|
|
@ -77,6 +77,7 @@ import {
|
||||||
import { useOpenSpaceSettings } from '../../../state/hooks/spaceSettings';
|
import { useOpenSpaceSettings } from '../../../state/hooks/spaceSettings';
|
||||||
import { useRoomNavigate } from '../../../hooks/useRoomNavigate';
|
import { useRoomNavigate } from '../../../hooks/useRoomNavigate';
|
||||||
import { CallNavStatus } from '../../../features/room-nav/RoomCallNavStatus';
|
import { CallNavStatus } from '../../../features/room-nav/RoomCallNavStatus';
|
||||||
|
import { useCallState } from '../call/CallProvider';
|
||||||
|
|
||||||
type SpaceMenuProps = {
|
type SpaceMenuProps = {
|
||||||
room: Room;
|
room: Room;
|
||||||
|
|
@ -299,6 +300,7 @@ export function Space() {
|
||||||
const selectedRoomId = useSelectedRoom();
|
const selectedRoomId = useSelectedRoom();
|
||||||
const lobbySelected = useSpaceLobbySelected(spaceIdOrAlias);
|
const lobbySelected = useSpaceLobbySelected(spaceIdOrAlias);
|
||||||
const searchSelected = useSpaceSearchSelected(spaceIdOrAlias);
|
const searchSelected = useSpaceSearchSelected(spaceIdOrAlias);
|
||||||
|
const { isCallActive, activeCallRoomId } = useCallState();
|
||||||
|
|
||||||
const [closedCategories, setClosedCategories] = useAtom(useClosedNavCategoriesAtom());
|
const [closedCategories, setClosedCategories] = useAtom(useClosedNavCategoriesAtom());
|
||||||
|
|
||||||
|
|
@ -320,10 +322,13 @@ export function Space() {
|
||||||
if (!closedCategories.has(makeNavCategoryId(space.roomId, parentId))) {
|
if (!closedCategories.has(makeNavCategoryId(space.roomId, parentId))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const showRoomAnyway = roomToUnread.has(roomId) || roomId === selectedRoomId;
|
const showRoomAnyway =
|
||||||
|
roomToUnread.has(roomId) ||
|
||||||
|
roomId === selectedRoomId ||
|
||||||
|
(isCallActive && activeCallRoomId === roomId);
|
||||||
return !showRoomAnyway;
|
return !showRoomAnyway;
|
||||||
},
|
},
|
||||||
[space.roomId, closedCategories, roomToUnread, selectedRoomId]
|
[space.roomId, closedCategories, roomToUnread, selectedRoomId, activeCallRoomId, isCallActive]
|
||||||
),
|
),
|
||||||
useCallback(
|
useCallback(
|
||||||
(sId) => closedCategories.has(makeNavCategoryId(space.roomId, sId)),
|
(sId) => closedCategories.has(makeNavCategoryId(space.roomId, sId)),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue