@@ -14,7 +14,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
14
14
import { IQuickInputService , IQuickPickItem , IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput' ;
15
15
import { IRequestService } from 'vs/platform/request/common/request' ;
16
16
import { IStorageService , IStorageValueChangeEvent , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
17
- import { createSyncHeaders , IAuthenticationProvider , IResourceRefHandle , IUserDataSyncEnablementService } from 'vs/platform/userDataSync/common/userDataSync' ;
17
+ import { createSyncHeaders , IAuthenticationProvider , IResourceRefHandle } from 'vs/platform/userDataSync/common/userDataSync' ;
18
18
import { UserDataSyncStoreClient } from 'vs/platform/userDataSync/common/userDataSyncStoreService' ;
19
19
import { AuthenticationSession , AuthenticationSessionsChangeEvent , IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication' ;
20
20
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions' ;
@@ -23,6 +23,7 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
23
23
import { generateUuid } from 'vs/base/common/uuid' ;
24
24
import { ICredentialsService } from 'vs/platform/credentials/common/credentials' ;
25
25
import { getCurrentAuthenticationSessionInfo } from 'vs/workbench/services/authentication/browser/authenticationService' ;
26
+ import { isWeb } from 'vs/base/common/platform' ;
26
27
27
28
type ExistingSession = IQuickPickItem & { session : AuthenticationSession & { providerId : string } } ;
28
29
type AuthenticationProviderOption = IQuickPickItem & { provider : IAuthenticationProvider } ;
@@ -57,7 +58,6 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
57
58
@IRequestService private readonly requestService : IRequestService ,
58
59
@IDialogService private readonly dialogService : IDialogService ,
59
60
@ICredentialsService private readonly credentialsService : ICredentialsService ,
60
- @IUserDataSyncEnablementService private readonly userDataSyncEnablementService : IUserDataSyncEnablementService ,
61
61
) {
62
62
super ( ) ;
63
63
@@ -202,7 +202,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
202
202
}
203
203
204
204
// If settings sync is already enabled, avoid asking again to authenticate
205
- if ( this . userDataSyncEnablementService . isEnabled ( ) ) {
205
+ if ( this . shouldAttemptEditSessionInit ( ) ) {
206
206
this . logService . info ( `Reusing user data sync enablement` ) ;
207
207
const authenticationSessionInfo = await getCurrentAuthenticationSessionInfo ( this . credentialsService , this . productService ) ;
208
208
if ( authenticationSessionInfo !== undefined ) {
@@ -222,6 +222,10 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes
222
222
return undefined ;
223
223
}
224
224
225
+ private shouldAttemptEditSessionInit ( ) : boolean {
226
+ return isWeb && this . storageService . isNew ( StorageScope . APPLICATION ) && this . storageService . isNew ( StorageScope . WORKSPACE ) ;
227
+ }
228
+
225
229
/**
226
230
*
227
231
* Prompts the user to pick an authentication option for storing and getting edit sessions.
0 commit comments