Merge pull request #5330 from matrix-org/travis/fix-user-info
Don't show admin tooling if we're not in the roompull/21833/head
commit
d5e9d5306a
|
@ -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 New Issue