forked from mystiq/hydrogen-web
Check timeline before state
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
4ddc7c0683
commit
2cae7c41d3
1 changed files with 1 additions and 1 deletions
|
@ -270,7 +270,7 @@ export class Room extends BaseRoom {
|
||||||
|
|
||||||
_getPowerLevelsEvent(roomResponse) {
|
_getPowerLevelsEvent(roomResponse) {
|
||||||
const isPowerlevelEvent = event => event.type === POWERLEVELS_EVENT_TYPE;
|
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;
|
return powerLevelEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue