Skip to content

Commit

Permalink
Ensure we only ever set workspace initialized to true
Browse files Browse the repository at this point in the history
This is just a guard in case there are paths where the workspace is
already marked as initialized but the workspace configuration is not and
we end up actually un-initializing it.
  • Loading branch information
code-asher committed Nov 28, 2023
1 parent 73cb236 commit 0c98611
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions patches/local-storage.diff
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,16 @@ Index: code-server/lib/vscode/src/vs/workbench/services/configuration/browser/co
});
}));

@@ -550,6 +552,8 @@ export class WorkspaceService extends Di
@@ -550,6 +552,12 @@ export class WorkspaceService extends Di
previousFolders = this.workspace.folders;
this.workspace.update(workspace);
} else {
+ // The configuration could have updated before the promise resolved.
+ workspace.initialized = this.workspaceConfiguration.initialized;
+ // It is possible for the configuration to become initialized in between
+ // when the workspace was created and this function was called, so check
+ // the configuration again now.
+ if (!workspace.initialized && this.workspaceConfiguration.initialized) {
+ workspace.initialized = true;
+ }
this.workspace = workspace;
}

0 comments on commit 0c98611

Please sign in to comment.