diff --git a/src/app/features/room/RoomViewHeader.tsx b/src/app/features/room/RoomViewHeader.tsx
index e6b72a29..8df29312 100644
--- a/src/app/features/room/RoomViewHeader.tsx
+++ b/src/app/features/room/RoomViewHeader.tsx
@@ -239,7 +239,7 @@ export function RoomViewHeader() {
const mDirectsEvent = mx.getAccountData('m.direct');
const { roomId } = room;
return (
- Object.values(mDirectsEvent?.event.content).filter((e) => {
+ Object.values(mDirectsEvent?.event?.content).filter((e) => {
if (e.indexOf(roomId) === 0) return true;
}).length !== 0
);
@@ -341,7 +341,25 @@ export function RoomViewHeader() {
)}
- {room.isCallRoom && (
+ {(room.isCallRoom() && (
+
+
+ Chat
+
+ }
+ >
+ {(triggerRef) => (
+
+
+
+ )}
+
+
+ )) || (
{isDirectMessage() && (
)}
- {room.isCallRoom() && (
-
-
- Chat
-
- }
- >
- {(triggerRef) => (
-
-
-
- )}
-
-
- )}
);