@@ -57,15 +57,17 @@ export abstract class AbstractUserDataSyncStoreManagementService extends Disposa
5757 const syncStore = value as ConfigurationSyncStore ;
5858 const type : UserDataSyncStoreType | undefined = this . storageService . get ( SYNC_SERVICE_URL_TYPE , StorageScope . GLOBAL ) as UserDataSyncStoreType | undefined ;
5959 const url = configuredStore ?. url
60- || ( type === 'insiders' ? syncStore . insidersUrl : type === 'stable' ? syncStore . stableUrl : undefined )
61- || syncStore . url ;
60+ || type === 'insiders' ? syncStore . insidersUrl
61+ : type === 'stable' ? syncStore . stableUrl
62+ : syncStore . url ;
6263 return {
6364 url : URI . parse ( url ) ,
6465 type,
6566 defaultType : syncStore . url === syncStore . insidersUrl ? 'insiders' : syncStore . url === syncStore . stableUrl ? 'stable' : undefined ,
6667 defaultUrl : URI . parse ( syncStore . url ) ,
67- stableUrl : syncStore . stableUrl ? URI . parse ( syncStore . stableUrl ) : undefined ,
68- insidersUrl : syncStore . insidersUrl ? URI . parse ( syncStore . insidersUrl ) : undefined ,
68+ stableUrl : URI . parse ( syncStore . stableUrl ) ,
69+ insidersUrl : URI . parse ( syncStore . insidersUrl ) ,
70+ canSwitch : ! ! syncStore . canSwitch ,
6971 authenticationProviders : Object . keys ( syncStore . authenticationProviders ) . reduce < IAuthenticationProvider [ ] > ( ( result , id ) => {
7072 result . push ( { id, scopes : syncStore ! . authenticationProviders [ id ] . scopes } ) ;
7173 return result ;
@@ -110,8 +112,8 @@ export class UserDataSyncStoreManagementService extends AbstractUserDataSyncStor
110112 }
111113
112114 async switch ( type : UserDataSyncStoreType ) : Promise < void > {
113- if ( type !== this . userDataSyncStore ? .type ) {
114- if ( type === this . userDataSyncStore ? .defaultType ) {
115+ if ( this . userDataSyncStore ?. canSwitch && type !== this . userDataSyncStore . type ) {
116+ if ( type === this . userDataSyncStore . defaultType ) {
115117 this . storageService . remove ( SYNC_SERVICE_URL_TYPE , StorageScope . GLOBAL ) ;
116118 } else {
117119 this . storageService . store ( SYNC_SERVICE_URL_TYPE , type , StorageScope . GLOBAL ) ;
0 commit comments