Fix demote yourself issue

This commit is contained in:
Benoit Marty 2020-06-11 16:48:32 +02:00
parent 959be3a23d
commit 3430a8f3ea

View file

@ -159,7 +159,7 @@ class RoomMemberProfileViewModel @AssistedInject constructor(@Assisted private v
val myPowerLevel = PowerLevelsHelper(currentPowerLevelsContent).getUserPowerLevelValue(session.myUserId)
if (action.askForValidation && action.newValue >= myPowerLevel) {
_viewEvents.post(RoomMemberProfileViewEvents.ShowPowerLevelValidation(action.previousValue, action.newValue))
} else if (state.isMine) {
} else if (action.askForValidation && state.isMine) {
_viewEvents.post(RoomMemberProfileViewEvents.ShowPowerLevelDemoteWarning(action.previousValue, action.newValue))
} else {
currentPowerLevelsContent.users[state.userId] = action.newValue