@@ -44,7 +44,7 @@ import { Link } from 'vs/platform/opener/browser/link';
4444import { IOpenerService } from 'vs/platform/opener/common/opener' ;
4545import { IProductService } from 'vs/platform/product/common/productService' ;
4646import { 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' ;
4848import { ITelemetryService , TelemetryLevel , firstSessionDateStorageKey } from 'vs/platform/telemetry/common/telemetry' ;
4949import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils' ;
5050import { defaultButtonStyles , defaultToggleStyles } from 'vs/platform/theme/browser/defaultStyles' ;
@@ -282,6 +282,27 @@ export class GettingStartedPage extends EditorPane {
282282 }
283283 this . updateCategoryProgress ( ) ;
284284 } ) ) ;
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+ } ) ) ;
285306 }
286307
287308 // remove when 'workbench.welcomePage.preferReducedMotion' deprecated
0 commit comments