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

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Jul 14, 2023
1 parent 69c785c commit d981df2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,8 @@ const MuteToggleButton: React.FC<IBaseRoomProps> = ({
const target = member.userId;

const powerLevelEvent = room.currentState.getStateEvents("m.room.power_levels", "");
if (!powerLevelEvent) {
stopUpdating();
return;
}

const powerLevels = powerLevelEvent.getContent();
const levelToSend =
(powerLevels.events ? powerLevels.events["m.room.message"] : null) || powerLevels.events_default;
const powerLevels = powerLevelEvent?.getContent();
const levelToSend = powerLevels?.events?.["m.room.message"] ?? powerLevels?.events_default;
let level;
if (muted) {
// unmute
Expand Down

0 comments on commit d981df2

Please sign in to comment.