@@ -350,22 +350,26 @@ export abstract class FilterViewContainerViewlet extends ViewContainerViewlet {
350350 } ) ) ;
351351
352352 this . _register ( this . viewsModel . onDidChangeActiveViews ( ( viewDescriptors ) => {
353- viewDescriptors . forEach ( descriptor => {
354- let filterOnValue = this . getFilterOn ( descriptor ) ;
355- if ( ! filterOnValue ) {
356- return ;
357- }
358- if ( ! this . allViews . has ( filterOnValue ) ) {
359- this . allViews . set ( filterOnValue , new Map ( ) ) ;
360- }
361- this . allViews . get ( filterOnValue ) ! . set ( descriptor . id , descriptor ) ;
362- if ( filterOnValue !== this . filterValue ) {
363- this . viewsModel . setVisible ( descriptor . id , false ) ;
364- }
365- } ) ;
353+ this . updateAllViews ( viewDescriptors ) ;
366354 } ) ) ;
367355 }
368356
357+ private updateAllViews ( viewDescriptors : IViewDescriptor [ ] ) {
358+ viewDescriptors . forEach ( descriptor => {
359+ let filterOnValue = this . getFilterOn ( descriptor ) ;
360+ if ( ! filterOnValue ) {
361+ return ;
362+ }
363+ if ( ! this . allViews . has ( filterOnValue ) ) {
364+ this . allViews . set ( filterOnValue , new Map ( ) ) ;
365+ }
366+ this . allViews . get ( filterOnValue ) ! . set ( descriptor . id , descriptor ) ;
367+ if ( filterOnValue !== this . filterValue ) {
368+ this . viewsModel . setVisible ( descriptor . id , false ) ;
369+ }
370+ } ) ;
371+ }
372+
369373 protected addConstantViewDescriptors ( constantViewDescriptors : IViewDescriptor [ ] ) {
370374 constantViewDescriptors . forEach ( viewDescriptor => this . constantViewDescriptors . set ( viewDescriptor . id , viewDescriptor ) ) ;
371375 }
@@ -415,6 +419,10 @@ export abstract class FilterViewContainerViewlet extends ViewContainerViewlet {
415419 }
416420
417421 onDidAddViews ( added : IAddedViewDescriptorRef [ ] ) : ViewletPanel [ ] {
422+ // Check that allViews is ready
423+ if ( this . allViews . size === 0 ) {
424+ this . updateAllViews ( this . viewsModel . viewDescriptors ) ;
425+ }
418426 const panels : ViewletPanel [ ] = super . onDidAddViews ( added ) ;
419427 for ( let i = 0 ; i < added . length ; i ++ ) {
420428 if ( this . constantViewDescriptors . has ( added [ i ] . viewDescriptor . id ) ) {
0 commit comments