@@ -44,7 +44,7 @@ import { Link } from 'vs/platform/opener/browser/link';
44
44
import { IOpenerService } from 'vs/platform/opener/common/opener' ;
45
45
import { IProductService } from 'vs/platform/product/common/productService' ;
46
46
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput' ;
47
- import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
47
+ import { IStorageService , StorageScope , StorageTarget , WillSaveStateReason } from 'vs/platform/storage/common/storage' ;
48
48
import { ITelemetryService , TelemetryLevel , firstSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry' ;
49
49
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils' ;
50
50
import { defaultButtonStyles , defaultToggleStyles } from 'vs/platform/theme/browser/defaultStyles' ;
@@ -282,6 +282,27 @@ export class GettingStartedPage extends EditorPane {
282
282
}
283
283
this . updateCategoryProgress ( ) ;
284
284
} ) ) ;
285
+
286
+ this . _register ( this . storageService . onWillSaveState ( ( e ) => {
287
+ if ( e . reason !== WillSaveStateReason . SHUTDOWN ) {
288
+ return ;
289
+ }
290
+
291
+ if ( this . workspaceContextService . getWorkspace ( ) . folders . length !== 0 ) {
292
+ return ;
293
+ }
294
+
295
+ if ( ! this . editorInput || ! this . currentWalkthrough || ! this . editorInput . selectedCategory || ! this . editorInput . selectedStep ) {
296
+ return ;
297
+ }
298
+
299
+ // Save the state of the walkthrough so we can restore it on reload
300
+ const restoreData : RestoreWalkthroughsConfigurationValue = { folder : UNKNOWN_EMPTY_WINDOW_WORKSPACE . id , category : this . editorInput . selectedCategory , step : this . editorInput . selectedStep } ;
301
+ this . storageService . store (
302
+ restoreWalkthroughsConfigurationKey ,
303
+ JSON . stringify ( restoreData ) ,
304
+ StorageScope . PROFILE , StorageTarget . MACHINE ) ;
305
+ } ) ) ;
285
306
}
286
307
287
308
// remove when 'workbench.welcomePage.preferReducedMotion' deprecated
0 commit comments