@@ -591,6 +591,8 @@ class TimelinePanel extends React.Component<IProps, IState> {
591
591
const dir = backwards ? EventTimeline . BACKWARDS : EventTimeline . FORWARDS ;
592
592
const canPaginateKey = backwards ? "canBackPaginate" : "canForwardPaginate" ;
593
593
const paginatingKey = backwards ? "backPaginating" : "forwardPaginating" ;
594
+ type CanPaginateKey = typeof canPaginateKey ;
595
+ type PaginatingKey = typeof paginatingKey ;
594
596
595
597
if ( ! this . state [ canPaginateKey ] ) {
596
598
debuglog ( "have given up" , dir , "paginating this timeline" ) ;
@@ -599,7 +601,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
599
601
600
602
if ( ! this . timelineWindow ?. canPaginate ( dir ) ) {
601
603
debuglog ( "can't" , dir , "paginate any further" ) ;
602
- this . setState ( { [ canPaginateKey ] : false } as Pick < IState , typeof canPaginateKey > ) ;
604
+ this . setState ( { [ canPaginateKey ] : false } as Pick < IState , CanPaginateKey > ) ;
603
605
return Promise . resolve ( false ) ;
604
606
}
605
607
@@ -609,7 +611,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
609
611
}
610
612
611
613
debuglog ( "Initiating paginate; backwards:" + backwards ) ;
612
- this . setState ( { [ paginatingKey ] : true } as Pick < IState , typeof paginatingKey > ) ;
614
+ this . setState ( { [ paginatingKey ] : true } as Pick < IState , PaginatingKey > ) ;
613
615
614
616
return this . onPaginationRequest ( this . timelineWindow , dir , PAGINATE_SIZE ) . then ( async ( r ) => {
615
617
if ( this . unmounted ) {
@@ -624,13 +626,13 @@ class TimelinePanel extends React.Component<IProps, IState> {
624
626
625
627
const { events, liveEvents, firstVisibleEventIndex } = this . getEvents ( ) ;
626
628
this . buildLegacyCallEventGroupers ( events ) ;
627
- const newState : Partial < IState > = {
629
+ const newState = {
628
630
[ paginatingKey ] : false ,
629
631
[ canPaginateKey ] : r ,
630
632
events,
631
633
liveEvents,
632
634
firstVisibleEventIndex,
633
- } ;
635
+ } as Pick < IState , PaginatingKey | CanPaginateKey | "events" | "liveEvents" | "firstVisibleEventIndex" > ;
634
636
635
637
// moving the window in this direction may mean that we can now
636
638
// paginate in the other where we previously could not.
@@ -647,7 +649,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
647
649
// has in memory because we never gave the component a chance to scroll
648
650
// itself into the right place
649
651
return new Promise ( ( resolve ) => {
650
- this . setState < null > ( newState , ( ) => {
652
+ this . setState ( newState , ( ) => {
651
653
// we can continue paginating in the given direction if:
652
654
// - timelineWindow.paginate says we can
653
655
// - we're paginating forwards, or we won't be trying to
0 commit comments