Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 964b340

Browse files
committed
disable promise short-circuiting for now
1 parent e79297b commit 964b340

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

src/components/structures/TimelinePanel.tsx

+12-20
Original file line numberDiff line numberDiff line change
@@ -1409,24 +1409,16 @@ class TimelinePanel extends React.Component<IProps, IState> {
14091409
// quite slow. So we detect that situation and shortcut straight to
14101410
// calling _reloadEvents and updating the state.
14111411

1412-
const timeline = this.props.timelineSet.getTimelineForEvent(eventId);
1413-
if (timeline) {
1414-
// This is a hot-path optimization by skipping a promise tick
1415-
// by repeating a no-op sync branch in TimelineSet.getTimelineForEvent & MatrixClient.getEventTimeline
1416-
this.timelineWindow.load(eventId, INITIAL_SIZE); // in this branch this method will happen in sync time
1417-
onLoaded();
1418-
} else {
1419-
const prom = this.timelineWindow.load(eventId, INITIAL_SIZE);
1420-
this.buildLegacyCallEventGroupers();
1421-
this.setState({
1422-
events: [],
1423-
liveEvents: [],
1424-
canBackPaginate: false,
1425-
canForwardPaginate: false,
1426-
timelineLoading: true,
1427-
});
1428-
prom.then(onLoaded, onError);
1429-
}
1412+
const prom = this.timelineWindow.load(eventId, INITIAL_SIZE);
1413+
this.buildLegacyCallEventGroupers();
1414+
this.setState({
1415+
events: [],
1416+
liveEvents: [],
1417+
canBackPaginate: false,
1418+
canForwardPaginate: false,
1419+
timelineLoading: true,
1420+
});
1421+
prom.then(onLoaded, onError);
14301422
}
14311423

14321424
// handle the completion of a timeline load or localEchoUpdate, by
@@ -1443,8 +1435,8 @@ class TimelinePanel extends React.Component<IProps, IState> {
14431435
}
14441436

14451437
// Force refresh the timeline before threads support pending events
1446-
public refreshTimeline(): void {
1447-
this.loadTimeline();
1438+
public refreshTimeline(eventId?: string): void {
1439+
this.loadTimeline(eventId, undefined, undefined, false);
14481440
this.reloadEvents();
14491441
}
14501442

0 commit comments

Comments
 (0)