Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5f3f7b5

Browse files
committed
Don't show admin tooling if we're not in the room
Fixes element-hq/element-web#15480
1 parent 3a0833e commit 5f3f7b5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/views/right_panel/UserInfo.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,11 @@ const RoomAdminToolsContainer: React.FC<IBaseRoomProps> = ({
801801
} = powerLevels;
802802

803803
const me = room.getMember(cli.getUserId());
804+
if (!me) {
805+
// we aren't in the room, so return no admin tooling
806+
return <div />;
807+
}
808+
804809
const isMe = me.userId === member.userId;
805810
const canAffectUser = member.powerLevel < me.powerLevel || isMe;
806811

0 commit comments

Comments
 (0)