mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
Fix #100348
This commit is contained in:
@@ -219,8 +219,14 @@ export class UserDataAutoSyncService extends UserDataAutoSyncEnablementService i
|
||||
this.telemetryService.publicLog2<{ code: string }, AutoSyncErrorClassification>(`autosync/error`, { code: userDataSyncError.code });
|
||||
}
|
||||
|
||||
// Turned off from another device or session got expired
|
||||
if (userDataSyncError.code === UserDataSyncErrorCode.TurnedOff || userDataSyncError.code === UserDataSyncErrorCode.SessionExpired) {
|
||||
// Session got expired
|
||||
if (userDataSyncError.code === UserDataSyncErrorCode.SessionExpired) {
|
||||
await this.turnOff(false, true /* force soft turnoff on error */);
|
||||
this.logService.info('Auto Sync: Turned off sync because current session is expired');
|
||||
}
|
||||
|
||||
// Turned off from another device
|
||||
if (userDataSyncError.code === UserDataSyncErrorCode.TurnedOff) {
|
||||
await this.turnOff(false, true /* force soft turnoff on error */);
|
||||
this.logService.info('Auto Sync: Turned off sync because sync is turned off in the cloud');
|
||||
}
|
||||
|
||||
@@ -270,11 +270,19 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
|
||||
private onAutoSyncError(error: UserDataSyncError): void {
|
||||
switch (error.code) {
|
||||
case UserDataSyncErrorCode.TurnedOff:
|
||||
case UserDataSyncErrorCode.SessionExpired:
|
||||
this.notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: localize('turned off', "Preferences sync was turned off from another device."),
|
||||
message: localize('session expired', "Preferences sync was turned off because current session is expired, please sign in again to turn on sync."),
|
||||
actions: {
|
||||
primary: [new Action('turn on sync', localize('turn on sync', "Turn on Preferences Sync..."), undefined, true, () => this.turnOn())]
|
||||
}
|
||||
});
|
||||
break;
|
||||
case UserDataSyncErrorCode.TurnedOff:
|
||||
this.notificationService.notify({
|
||||
severity: Severity.Info,
|
||||
message: localize('turned off', "Preferences sync was turned off from another device, please sign in again to turn on sync."),
|
||||
actions: {
|
||||
primary: [new Action('turn on sync', localize('turn on sync', "Turn on Preferences Sync..."), undefined, true, () => this.turnOn())]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user