Skip to content

Commit a8794c2

Browse files
committed
We don't care about the timeline (just fire and forget)
Split out from #2521 Context: #2521 (comment)
1 parent 4a33e58 commit a8794c2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/timeline-window.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class TimelineWindow {
101101
*
102102
* @return {Promise}
103103
*/
104-
public load(initialEventId?: string, initialWindowSize = 20): Promise<void> {
104+
public async load(initialEventId?: string, initialWindowSize = 20): Promise<void> {
105105
// given an EventTimeline, find the event we were looking for, and initialise our
106106
// fields so that the event in question is in the middle of the window.
107107
const initFields = (timeline: Optional<EventTimeline>) => {
@@ -135,13 +135,14 @@ export class TimelineWindow {
135135
// which is important to keep room-switching feeling snappy.
136136
if (this.timelineSet.getTimelineForEvent(initialEventId)) {
137137
initFields(this.timelineSet.getTimelineForEvent(initialEventId));
138-
return Promise.resolve();
138+
return;
139139
} else if (initialEventId) {
140-
return this.client.getEventTimeline(this.timelineSet, initialEventId)
140+
await this.client.getEventTimeline(this.timelineSet, initialEventId)
141141
.then(initFields);
142+
return;
142143
} else {
143144
initFields(this.timelineSet.getLiveTimeline());
144-
return Promise.resolve();
145+
return;
145146
}
146147
}
147148

0 commit comments

Comments
 (0)