@@ -242,7 +242,28 @@ export class GettingStartedPage extends EditorPane {
242
242
}
243
243
} ) ) ;
244
244
245
- this . _register ( this . gettingStartedService . onDidAddBuiltInWalkthrough ( rerender ) ) ;
245
+ this . _register ( this . gettingStartedService . onDidAddBuiltInWalkthrough ( ( ) => {
246
+ rerender ( ) ;
247
+ const someStepsComplete = this . gettingStartedCategories . some ( category => category . steps . find ( s => s . done ) ) ;
248
+ if ( ! this . productService . openToWelcomeMainPage && ! someStepsComplete && ! this . hasScrolledToFirstCategory ) {
249
+ const firstSessionDateString = this . storageService . get ( firstSessionDateStorageKey , StorageScope . APPLICATION ) || new Date ( ) . toUTCString ( ) ;
250
+ const daysSinceFirstSession = ( ( + new Date ( ) ) - ( + new Date ( firstSessionDateString ) ) ) / 1000 / 60 / 60 / 24 ;
251
+ const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index' ;
252
+
253
+ if ( fistContentBehaviour === 'openToFirstCategory' ) {
254
+ const first = this . gettingStartedCategories . filter ( c => ! c . when || this . contextService . contextMatchesRules ( c . when ) ) [ 0 ] ;
255
+ this . hasScrolledToFirstCategory = true ;
256
+ if ( first ) {
257
+ this . currentWalkthrough = first ;
258
+ this . editorInput . selectedCategory = this . currentWalkthrough ?. id ;
259
+ this . buildCategorySlide ( this . editorInput . selectedCategory , undefined ) ;
260
+ this . setSlide ( 'details' ) ;
261
+ return ;
262
+ }
263
+ }
264
+ }
265
+ } ) ) ;
266
+
246
267
this . _register ( this . gettingStartedService . onDidAddWalkthrough ( rerender ) ) ;
247
268
this . _register ( this . gettingStartedService . onDidRemoveWalkthrough ( rerender ) ) ;
248
269
@@ -872,29 +893,11 @@ export class GettingStartedPage extends EditorPane {
872
893
}
873
894
}
874
895
875
- const someStepsComplete = this . gettingStartedCategories . some ( category => category . steps . find ( s => s . done ) ) ;
876
896
if ( this . editorInput . showTelemetryNotice && this . productService . openToWelcomeMainPage ) {
877
897
const telemetryNotice = $ ( 'p.telemetry-notice' ) ;
878
898
this . buildTelemetryFooter ( telemetryNotice ) ;
879
899
footer . appendChild ( telemetryNotice ) ;
880
- } else if ( ! this . productService . openToWelcomeMainPage && ! someStepsComplete && ! this . hasScrolledToFirstCategory ) {
881
- const firstSessionDateString = this . storageService . get ( firstSessionDateStorageKey , StorageScope . APPLICATION ) || new Date ( ) . toUTCString ( ) ;
882
- const daysSinceFirstSession = ( ( + new Date ( ) ) - ( + new Date ( firstSessionDateString ) ) ) / 1000 / 60 / 60 / 24 ;
883
- const fistContentBehaviour = daysSinceFirstSession < 1 ? 'openToFirstCategory' : 'index' ;
884
-
885
- if ( fistContentBehaviour === 'openToFirstCategory' ) {
886
- const first = this . gettingStartedCategories . filter ( c => ! c . when || this . contextService . contextMatchesRules ( c . when ) ) [ 0 ] ;
887
- this . hasScrolledToFirstCategory = true ;
888
- if ( first ) {
889
- this . currentWalkthrough = first ;
890
- this . editorInput . selectedCategory = this . currentWalkthrough ?. id ;
891
- this . buildCategorySlide ( this . editorInput . selectedCategory , undefined ) ;
892
- this . setSlide ( 'details' ) ;
893
- return ;
894
- }
895
- }
896
900
}
897
-
898
901
this . setSlide ( 'categories' ) ;
899
902
}
900
903
0 commit comments