Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fixed warning pop up when admin changes power to custome level 100
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumeb committed Apr 6, 2022
1 parent 35c49a8 commit c9e209e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ const PowerLevelEditor: React.FC<{

const myUserId = cli.getUserId();
const myPower = powerLevelEvent.getContent().users[myUserId];
if (myPower && parseInt(myPower) === powerLevel) {
if (myPower && parseInt(myPower) === powerLevel && myUserId !== target) {
const { finished } = Modal.createTrackedDialog('Promote to PL100 Warning', '', QuestionDialog, {
title: _t("Warning!"),
description:
Expand All @@ -1038,7 +1038,7 @@ const PowerLevelEditor: React.FC<{

const [confirmed] = await finished;
if (!confirmed) return;
} else if (myUserId === target) {
} else if (myUserId === target && powerLevel !== 100) {
// If we are changing our own PL it can only ever be decreasing, which we cannot reverse.
try {
if (!(await warnSelfDemote(room?.isSpaceRoom()))) return;
Expand Down

0 comments on commit c9e209e

Please sign in to comment.