Don't show admin tooling if we're not in the room
Fixes https://github.com/vector-im/element-web/issues/15480
This commit is contained in:
parent
3a0833e8a4
commit
5f3f7b5263
1 changed files with 5 additions and 0 deletions
|
@ -801,6 +801,11 @@ const RoomAdminToolsContainer: React.FC<IBaseRoomProps> = ({
|
||||||
} = powerLevels;
|
} = powerLevels;
|
||||||
|
|
||||||
const me = room.getMember(cli.getUserId());
|
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 isMe = me.userId === member.userId;
|
||||||
const canAffectUser = member.powerLevel < me.powerLevel || isMe;
|
const canAffectUser = member.powerLevel < me.powerLevel || isMe;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue