Don't show admin tooling if we're not in the room

Fixes https://github.com/vector-im/element-web/issues/15480
pull/21833/head
Travis Ralston 2020-10-16 13:43:08 -06:00
parent 3a0833e8a4
commit 5f3f7b5263
1 changed files with 5 additions and 0 deletions

View File

@ -801,6 +801,11 @@ const RoomAdminToolsContainer: React.FC<IBaseRoomProps> = ({
} = powerLevels;
const me = room.getMember(cli.getUserId());
if (!me) {
// we aren't in the room, so return no admin tooling
return <div />;
}
const isMe = me.userId === member.userId;
const canAffectUser = member.powerLevel < me.powerLevel || isMe;