@@ -82,6 +82,7 @@ import { UserDataProfileService } from 'vs/workbench/services/userDataProfile/co
82
82
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile' ;
83
83
import { BrowserUserDataProfilesService } from 'vs/platform/userDataProfile/browser/userDataProfile' ;
84
84
import { timeout } from 'vs/base/common/async' ;
85
+ import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration' ;
85
86
86
87
export class BrowserMain extends Disposable {
87
88
@@ -288,6 +289,21 @@ export class BrowserMain extends Disposable {
288
289
const userDataProfileService = new UserDataProfileService ( currentProfile , userDataProfilesService ) ;
289
290
serviceCollection . set ( IUserDataProfileService , userDataProfileService ) ;
290
291
292
+ let isProfilesEnablementConfigured = false ;
293
+ if ( environmentService . remoteAuthority ) {
294
+ // Always Disabled in web with remote connection
295
+ userDataProfilesService . setEnablement ( false ) ;
296
+ } else {
297
+ if ( productService . quality === 'stable' ) {
298
+ // Enabled from Config
299
+ userDataProfilesService . setEnablement ( window . localStorage . getItem ( PROFILES_ENABLEMENT_CONFIG ) === 'true' ) ;
300
+ isProfilesEnablementConfigured = true ;
301
+ } else {
302
+ // Always Enabled
303
+ userDataProfilesService . setEnablement ( true ) ;
304
+ }
305
+ }
306
+
291
307
// Long running services (workspace, config, storage)
292
308
const [ configurationService , storageService ] = await Promise . all ( [
293
309
this . createWorkspaceService ( workspace , environmentService , userDataProfileService , userDataProfilesService , fileService , remoteAgentService , uriIdentityService , logService ) . then ( service => {
@@ -310,12 +326,14 @@ export class BrowserMain extends Disposable {
310
326
} )
311
327
] ) ;
312
328
313
- userDataProfilesService . setEnablement ( ! environmentService . remoteAuthority && ( productService . quality !== 'stable' || configurationService . getValue ( PROFILES_ENABLEMENT_CONFIG ) ) ) ;
314
- this . _register ( configurationService . onDidChangeConfiguration ( e => {
315
- if ( e . affectsConfiguration ( PROFILES_ENABLEMENT_CONFIG ) ) {
316
- userDataProfilesService . setEnablement ( ! ! configurationService . getValue ( PROFILES_ENABLEMENT_CONFIG ) ) ;
317
- }
318
- } ) ) ;
329
+ if ( isProfilesEnablementConfigured ) {
330
+ userDataProfilesService . setEnablement ( ! ! configurationService . getValue ( PROFILES_ENABLEMENT_CONFIG ) ) ;
331
+ this . _register ( configurationService . onDidChangeConfiguration ( e => {
332
+ if ( e . source !== ConfigurationTarget . DEFAULT && e . affectsConfiguration ( PROFILES_ENABLEMENT_CONFIG ) ) {
333
+ window . localStorage . setItem ( PROFILES_ENABLEMENT_CONFIG , ! ! configurationService . getValue ( PROFILES_ENABLEMENT_CONFIG ) ? 'true' : 'false' ) ;
334
+ }
335
+ } ) ) ;
336
+ }
319
337
320
338
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
321
339
//
0 commit comments