File tree Expand file tree Collapse file tree
workbench/contrib/timeline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,10 +136,8 @@ export class GitTimelineProvider implements TimelineProvider {
136136 // sortByAuthorDate: true
137137 } ) ;
138138
139- const more = limit === undefined ? false : commits . length >= limit ;
140139 const paging = commits . length ? {
141- more : more ,
142- cursor : more ? commits [ commits . length - 1 ] ?. hash : undefined
140+ cursor : limit === undefined ? undefined : ( commits . length >= limit ? commits [ commits . length - 1 ] ?. hash : undefined )
143141 } : undefined ;
144142
145143 // If we asked for an extra commit, strip it off
Original file line number Diff line number Diff line change @@ -1895,13 +1895,9 @@ declare module 'vscode' {
18951895 readonly paging ?: {
18961896 /**
18971897 * A provider-defined cursor specifing the starting point of timeline items which are after the ones returned.
1898+ * Use `undefined` to signal that there are no more items to be returned.
18981899 */
1899- readonly cursor ?: string
1900-
1901- /**
1902- * A flag which indicates whether there are more items that weren't returned.
1903- */
1904- readonly more ?: boolean ;
1900+ readonly cursor : string | undefined ;
19051901 }
19061902
19071903 /**
Original file line number Diff line number Diff line change @@ -88,7 +88,6 @@ class TimelineAggregate {
8888 this . source = timeline . source ;
8989 this . items = timeline . items ;
9090 this . _cursor = timeline . paging ?. cursor ;
91- this . _more = timeline . paging ?. more ?? false ;
9291 this . lastRenderedIndex = - 1 ;
9392 }
9493
@@ -97,9 +96,8 @@ class TimelineAggregate {
9796 return this . _cursor ;
9897 }
9998
100- private _more : boolean ;
10199 get more ( ) : boolean {
102- return this . _more ;
100+ return this . _cursor !== undefined ;
103101 }
104102
105103 get newest ( ) : TimelineItem | undefined {
@@ -150,7 +148,6 @@ class TimelineAggregate {
150148 }
151149
152150 this . _cursor = timeline . paging ?. cursor ;
153- this . _more = timeline . paging ?. more ?? false ;
154151
155152 if ( updated ) {
156153 this . items . sort (
Original file line number Diff line number Diff line change @@ -54,8 +54,7 @@ export interface Timeline {
5454 items : TimelineItem [ ] ;
5555
5656 paging ?: {
57- cursor ?: string
58- more ?: boolean ;
57+ cursor : string | undefined ;
5958 }
6059}
6160
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ export class TimelineService implements ITimelineService {
5858 // }
5959 // ],
6060 // paging: {
61- // cursor: 'next',
62- // more: true
61+ // cursor: 'next'
6362 // }
6463 // });
6564 // }
@@ -84,7 +83,7 @@ export class TimelineService implements ITimelineService {
8483 // }
8584 // ],
8685 // paging: {
87- // more: false
86+ // cursor: undefined
8887 // }
8988 // });
9089 // },
You can’t perform that action at this time.
0 commit comments