@@ -41,6 +41,8 @@ export class PlotsModel extends ModelWithPersistence {
4141 private branchRevisions : Record < string , string > = { }
4242 private workspaceRunningCheckpoint : string | undefined
4343
44+ private fetchedRevs = new Set < string > ( )
45+
4446 private comparisonData : ComparisonData = { }
4547 private comparisonOrder : string [ ]
4648
@@ -97,7 +99,9 @@ export class PlotsModel extends ModelWithPersistence {
9799 return this . removeStaleData ( )
98100 }
99101
100- public async transformAndSetPlots ( data : PlotsOutput ) {
102+ public async transformAndSetPlots ( data : PlotsOutput , revs : string [ ] ) {
103+ this . fetchedRevs = new Set ( [ ...this . fetchedRevs , ...revs ] )
104+
101105 const [ { comparisonData, revisionData } , templates ] = await Promise . all ( [
102106 collectData ( data ) ,
103107 collectTemplates ( data )
@@ -153,6 +157,12 @@ export class PlotsModel extends ModelWithPersistence {
153157 }
154158 }
155159
160+ public getUnfetchedRevisions ( ) {
161+ return this . getSelectedRevisions ( ) . filter (
162+ revision => ! this . fetchedRevs . has ( revision )
163+ )
164+ }
165+
156166 public getMissingRevisions ( ) {
157167 const cachedRevisions = new Set ( [
158168 ...Object . keys ( this . comparisonData ) ,
@@ -306,6 +316,7 @@ export class PlotsModel extends ModelWithPersistence {
306316 if ( sha && this . branchRevisions [ id ] !== sha ) {
307317 delete this . revisionData [ id ]
308318 delete this . comparisonData [ id ]
319+ this . fetchedRevs . delete ( id )
309320 this . branchRevisions [ id ] = sha
310321 }
311322 }
0 commit comments