@@ -63,17 +63,11 @@ export class BrowserStorageService extends Disposable implements IStorageService
6363
6464 // Workspace Storage
6565 this . workspaceStorageFile = joinPath ( stateRoot , `${ payload . id } .json` ) ;
66+
6667 this . workspaceStorageDatabase = this . _register ( new FileStorageDatabase ( this . workspaceStorageFile , false /* do not watch for external changes */ , this . fileService ) ) ;
6768 this . workspaceStorage = this . _register ( new Storage ( this . workspaceStorageDatabase ) ) ;
6869 this . _register ( this . workspaceStorage . onDidChangeStorage ( key => this . _onDidChangeStorage . fire ( { key, scope : StorageScope . WORKSPACE } ) ) ) ;
6970
70- const firstOpen = this . workspaceStorage . getBoolean ( WorkspaceStorageSettings . WORKSPACE_FIRST_OPEN ) ;
71- if ( firstOpen === undefined ) {
72- this . workspaceStorage . set ( WorkspaceStorageSettings . WORKSPACE_FIRST_OPEN , ! ( await this . fileService . exists ( this . workspaceStorageFile ) ) ) ;
73- } else if ( firstOpen ) {
74- this . workspaceStorage . set ( WorkspaceStorageSettings . WORKSPACE_FIRST_OPEN , false ) ;
75- }
76-
7771 // Global Storage
7872 this . globalStorageFile = joinPath ( stateRoot , 'global.json' ) ;
7973 this . globalStorageDatabase = this . _register ( new FileStorageDatabase ( this . globalStorageFile , true /* watch for external changes */ , this . fileService ) ) ;
@@ -86,6 +80,15 @@ export class BrowserStorageService extends Disposable implements IStorageService
8680 this . globalStorage . init ( )
8781 ] ) ;
8882
83+ // Check to see if this is the first time we are "opening" this workspace
84+ const firstOpen = this . workspaceStorage . getBoolean ( WorkspaceStorageSettings . WORKSPACE_FIRST_OPEN ) ;
85+ if ( firstOpen === undefined ) {
86+ // NOTE@eamodio We can't reliably check to see if a workspace was added before this setting was introduced, so just pretend it is the first time
87+ this . workspaceStorage . set ( WorkspaceStorageSettings . WORKSPACE_FIRST_OPEN , true ) ;
88+ } else if ( firstOpen ) {
89+ this . workspaceStorage . set ( WorkspaceStorageSettings . WORKSPACE_FIRST_OPEN , false ) ;
90+ }
91+
8992 // In the browser we do not have support for long running unload sequences. As such,
9093 // we cannot ask for saving state in that moment, because that would result in a
9194 // long running operation.
0 commit comments