Update src/components/structures/MatrixChat.tsx
getContent already does the || {} step Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
parent
b3e535a7aa
commit
0c0706db22
1 changed files with 1 additions and 1 deletions
|
@ -1136,7 +1136,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
|
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const plEvent = roomToLeave.currentState.getStateEvents(EventType.RoomPowerLevels, '');
|
const plEvent = roomToLeave.currentState.getStateEvents(EventType.RoomPowerLevels, '');
|
||||||
const plContent = plEvent ? (plEvent.getContent() || {}) : {};
|
const plContent = plEvent ? plEvent.getContent() : {};
|
||||||
const userLevels = plContent.users || {};
|
const userLevels = plContent.users || {};
|
||||||
const currentUserLevel = userLevels[client.getUserId()];
|
const currentUserLevel = userLevels[client.getUserId()];
|
||||||
const userLevelValues = Object.values(userLevels);
|
const userLevelValues = Object.values(userLevels);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue