Skip to content

Commit

Permalink
Check timeline before state
Browse files Browse the repository at this point in the history
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
  • Loading branch information
MidhunSureshR committed Aug 6, 2021
1 parent 4ddc7c0 commit 2cae7c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/matrix/room/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export class Room extends BaseRoom {

_getPowerLevelsEvent(roomResponse) {
const isPowerlevelEvent = event => event.type === POWERLEVELS_EVENT_TYPE;
const powerLevelEvent = roomResponse.state?.events.find(isPowerlevelEvent) ?? roomResponse.timeline?.events.find(isPowerlevelEvent);
const powerLevelEvent = roomResponse.timeline.events.find(isPowerlevelEvent) ?? roomResponse.state.events.find(isPowerlevelEvent);
return powerLevelEvent;
}

Expand Down

0 comments on commit 2cae7c4

Please sign in to comment.