@@ -1408,24 +1408,16 @@ class TimelinePanel extends React.Component<IProps, IState> {
14081408 // quite slow. So we detect that situation and shortcut straight to
14091409 // calling _reloadEvents and updating the state.
14101410
1411- const timeline = this . props . timelineSet . getTimelineForEvent ( eventId ) ;
1412- if ( timeline ) {
1413- // This is a hot-path optimization by skipping a promise tick
1414- // by repeating a no-op sync branch in TimelineSet.getTimelineForEvent & MatrixClient.getEventTimeline
1415- this . timelineWindow . load ( eventId , INITIAL_SIZE ) ; // in this branch this method will happen in sync time
1416- onLoaded ( ) ;
1417- } else {
1418- const prom = this . timelineWindow . load ( eventId , INITIAL_SIZE ) ;
1419- this . buildLegacyCallEventGroupers ( ) ;
1420- this . setState ( {
1421- events : [ ] ,
1422- liveEvents : [ ] ,
1423- canBackPaginate : false ,
1424- canForwardPaginate : false ,
1425- timelineLoading : true ,
1426- } ) ;
1427- prom . then ( onLoaded , onError ) ;
1428- }
1411+ const prom = this . timelineWindow . load ( eventId , INITIAL_SIZE ) ;
1412+ this . buildLegacyCallEventGroupers ( ) ;
1413+ this . setState ( {
1414+ events : [ ] ,
1415+ liveEvents : [ ] ,
1416+ canBackPaginate : false ,
1417+ canForwardPaginate : false ,
1418+ timelineLoading : true ,
1419+ } ) ;
1420+ prom . then ( onLoaded , onError ) ;
14291421 }
14301422
14311423 // handle the completion of a timeline load or localEchoUpdate, by
@@ -1442,8 +1434,8 @@ class TimelinePanel extends React.Component<IProps, IState> {
14421434 }
14431435
14441436 // Force refresh the timeline before threads support pending events
1445- public refreshTimeline ( ) : void {
1446- this . loadTimeline ( ) ;
1437+ public refreshTimeline ( eventId ?: string ) : void {
1438+ this . loadTimeline ( eventId , undefined , undefined , false ) ;
14471439 this . reloadEvents ( ) ;
14481440 }
14491441
0 commit comments