mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Merge pull request #6733 from matrix-org/travis/fix-widgets
Don't rely on rooms having timelines to use when checking widgets
This commit is contained in:
commit
36f4b9f723
1 changed files with 3 additions and 1 deletions
|
@ -301,7 +301,9 @@ export class StopGapWidget extends EventEmitter {
|
||||||
// requests timeline capabilities in other rooms down the road. It's just easier to manage here.
|
// requests timeline capabilities in other rooms down the road. It's just easier to manage here.
|
||||||
for (const room of MatrixClientPeg.get().getRooms()) {
|
for (const room of MatrixClientPeg.get().getRooms()) {
|
||||||
// Timelines are most recent last
|
// Timelines are most recent last
|
||||||
this.readUpToMap[room.roomId] = arrayFastClone(room.getLiveTimeline().getEvents()).reverse()[0].getId();
|
const roomEvent = arrayFastClone(room.getLiveTimeline()?.getEvents() || []).reverse()[0];
|
||||||
|
if (!roomEvent) continue; // force later code to think the room is fresh
|
||||||
|
this.readUpToMap[room.roomId] = roomEvent.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attach listeners for feeding events - the underlying widget classes handle permissions for us
|
// Attach listeners for feeding events - the underlying widget classes handle permissions for us
|
||||||
|
|
Loading…
Reference in a new issue