From 699bbee544960e3198e82f3d59c11e7580df6293 Mon Sep 17 00:00:00 2001 From: Krishan <33421343+kfiven@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:29:39 +0530 Subject: [PATCH] Fix max power level in room permissions (#480) * Fix power level in permissions Fix allowed value of power level in room permissions, earlier the max value was 100 even if room members have power level more than 100. * Update RoomPermissions.jsx --- src/app/molecules/room-permissions/RoomPermissions.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/molecules/room-permissions/RoomPermissions.jsx b/src/app/molecules/room-permissions/RoomPermissions.jsx index d8046ae..989a939 100644 --- a/src/app/molecules/room-permissions/RoomPermissions.jsx +++ b/src/app/molecules/room-permissions/RoomPermissions.jsx @@ -179,6 +179,7 @@ function RoomPermissions({ roomId }) { const pLEvent = room.currentState.getStateEvents('m.room.power_levels')[0]; const permissions = pLEvent.getContent(); const canChangePermission = room.currentState.maySendStateEvent('m.room.power_levels', mx.getUserId()); + const myPowerLevel = room.getMember(mx.getUserId())?.powerLevel ?? 100; const handlePowerSelector = (e, permKey, parentKey, powerLevel) => { const handlePowerLevelChange = (newPowerLevel) => { @@ -208,7 +209,7 @@ function RoomPermissions({ roomId }) { (closeMenu) => ( { closeMenu(); handlePowerLevelChange(pl);