Skip to content

Commit 86223f3

Browse files
authored
fix initialzing profiles in web (microsoft#166112)
1 parent e5bf5a7 commit 86223f3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/vs/workbench/browser/web.main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,6 @@ export class BrowserMain extends Disposable {
284284
// User Data Profiles
285285
const userDataProfilesService = new BrowserUserDataProfilesService(environmentService, fileService, uriIdentityService, logService);
286286
serviceCollection.set(IUserDataProfilesService, userDataProfilesService);
287-
const lastActiveProfile = environmentService.lastActiveProfile ? userDataProfilesService.profiles.find(p => p.id === environmentService.lastActiveProfile) : undefined;
288-
const currentProfile = userDataProfilesService.getOrSetProfileForWorkspace(isWorkspaceIdentifier(workspace) || isSingleFolderWorkspaceIdentifier(workspace) ? workspace : 'empty-window', lastActiveProfile ?? userDataProfilesService.defaultProfile);
289-
const userDataProfileService = new UserDataProfileService(currentProfile, userDataProfilesService);
290-
serviceCollection.set(IUserDataProfileService, userDataProfileService);
291-
292287
let isProfilesEnablementConfigured = false;
293288
if (environmentService.remoteAuthority) {
294289
// Always Disabled in web with remote connection
@@ -304,6 +299,11 @@ export class BrowserMain extends Disposable {
304299
}
305300
}
306301

302+
const lastActiveProfile = environmentService.lastActiveProfile ? userDataProfilesService.profiles.find(p => p.id === environmentService.lastActiveProfile) : undefined;
303+
const currentProfile = userDataProfilesService.getOrSetProfileForWorkspace(isWorkspaceIdentifier(workspace) || isSingleFolderWorkspaceIdentifier(workspace) ? workspace : 'empty-window', lastActiveProfile ?? userDataProfilesService.defaultProfile);
304+
const userDataProfileService = new UserDataProfileService(currentProfile, userDataProfilesService);
305+
serviceCollection.set(IUserDataProfileService, userDataProfileService);
306+
307307
// Long running services (workspace, config, storage)
308308
const [configurationService, storageService] = await Promise.all([
309309
this.createWorkspaceService(workspace, environmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService).then(service => {

0 commit comments

Comments
 (0)