forked from github/cinny
Fix DM header since it *can* be a call room
This commit is contained in:
@@ -239,7 +239,7 @@ export function RoomViewHeader() {
|
|||||||
const mDirectsEvent = mx.getAccountData('m.direct');
|
const mDirectsEvent = mx.getAccountData('m.direct');
|
||||||
const { roomId } = room;
|
const { roomId } = room;
|
||||||
return (
|
return (
|
||||||
Object.values(mDirectsEvent?.event.content).filter((e) => {
|
Object.values(mDirectsEvent?.event?.content).filter((e) => {
|
||||||
if (e.indexOf(roomId) === 0) return true;
|
if (e.indexOf(roomId) === 0) return true;
|
||||||
}).length !== 0
|
}).length !== 0
|
||||||
);
|
);
|
||||||
@@ -341,7 +341,25 @@ export function RoomViewHeader() {
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
{room.isCallRoom && (
|
{(room.isCallRoom() && (
|
||||||
|
<Box>
|
||||||
|
<TooltipProvider
|
||||||
|
position="Bottom"
|
||||||
|
offset={4}
|
||||||
|
tooltip={
|
||||||
|
<Tooltip>
|
||||||
|
<Text>Chat</Text>
|
||||||
|
</Tooltip>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{(triggerRef) => (
|
||||||
|
<IconButton ref={triggerRef} onClick={toggleChat}>
|
||||||
|
<Icon size="400" src={Icons.Message} />
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
|
</TooltipProvider>
|
||||||
|
</Box>
|
||||||
|
)) || (
|
||||||
<Box shrink="No">
|
<Box shrink="No">
|
||||||
{isDirectMessage() && (
|
{isDirectMessage() && (
|
||||||
<TooltipProvider
|
<TooltipProvider
|
||||||
@@ -490,25 +508,6 @@ export function RoomViewHeader() {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
{room.isCallRoom() && (
|
|
||||||
<Box>
|
|
||||||
<TooltipProvider
|
|
||||||
position="Bottom"
|
|
||||||
offset={4}
|
|
||||||
tooltip={
|
|
||||||
<Tooltip>
|
|
||||||
<Text>Chat</Text>
|
|
||||||
</Tooltip>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{(triggerRef) => (
|
|
||||||
<IconButton ref={triggerRef} onClick={toggleChat}>
|
|
||||||
<Icon size="400" src={Icons.Message} />
|
|
||||||
</IconButton>
|
|
||||||
)}
|
|
||||||
</TooltipProvider>
|
|
||||||
</Box>
|
|
||||||
)}
|
|
||||||
</Box>
|
</Box>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user