@@ -253,7 +253,7 @@ export abstract class ViewNode<
253253 }
254254
255255 protected _uniqueId ! : string ;
256- protected splatted = false ;
256+ splatted = false ;
257257 // NOTE: @eamodio uncomment to track node leaks
258258 // readonly uuid = uuid();
259259
@@ -262,8 +262,12 @@ export abstract class ViewNode<
262262 // public readonly id: string | undefined,
263263 uri : GitUri ,
264264 public readonly view : TView ,
265- protected parent ?: ViewNode ,
265+ protected parent ?: ViewNode | undefined ,
266+ //** Indicates if this node is only shown as its children, not itself */
267+ splatted ?: boolean ,
266268 ) {
269+ this . splatted = splatted ?? false ;
270+
267271 // NOTE: @eamodio uncomment to track node leaks
268272 // queueMicrotask(() => this.view.registerNode(this));
269273 this . _uri = uri ;
@@ -339,32 +343,36 @@ export abstract class ViewNode<
339343
340344 getSplattedChild ?( ) : Promise < ViewNode | undefined > ;
341345
346+ protected get storedId ( ) : string | undefined {
347+ return this . id ;
348+ }
349+
342350 deleteState < T extends StateKey < State > = StateKey < State > > ( key ?: T ) : void {
343- if ( this . id == null ) {
351+ if ( this . storedId == null ) {
344352 debugger ;
345353 throw new Error ( 'Id is required to delete state' ) ;
346354 }
347- this . view . nodeState . deleteState ( this . id , key as string ) ;
355+ this . view . nodeState . deleteState ( this . storedId , key as string ) ;
348356 }
349357
350358 getState < T extends StateKey < State > = StateKey < State > > ( key : T ) : StateValue < State , T > | undefined {
351- if ( this . id == null ) {
359+ if ( this . storedId == null ) {
352360 debugger ;
353361 throw new Error ( 'Id is required to get state' ) ;
354362 }
355- return this . view . nodeState . getState ( this . id , key as string ) ;
363+ return this . view . nodeState . getState ( this . storedId , key as string ) ;
356364 }
357365
358366 storeState < T extends StateKey < State > = StateKey < State > > (
359367 key : T ,
360368 value : StateValue < State , T > ,
361369 sticky ?: boolean ,
362370 ) : void {
363- if ( this . id == null ) {
371+ if ( this . storedId == null ) {
364372 debugger ;
365373 throw new Error ( 'Id is required to store state' ) ;
366374 }
367- this . view . nodeState . storeState ( this . id , key as string , value , sticky ) ;
375+ this . view . nodeState . storeState ( this . storedId , key as string , value , sticky ) ;
368376 }
369377}
370378
0 commit comments