mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Merge from vscode 9bc92b48d945144abb405b9e8df05e18accb9148
This commit is contained in:
@@ -122,6 +122,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
this.onDidChangeEnablement(this.userDataSyncEnablementService.isEnabled());
|
||||
this._register(Event.debounce(userDataSyncService.onDidChangeStatus, () => undefined, 500)(() => this.onDidChangeSyncStatus(this.userDataSyncService.status)));
|
||||
this._register(userDataSyncService.onDidChangeConflicts(() => this.onDidChangeConflicts(this.userDataSyncService.conflictsSources)));
|
||||
this._register(this.userDataAuthTokenService.onTokenFailed(_ => this.authenticationService.getSessions(this.userDataSyncStore!.authenticationProviderId)));
|
||||
this._register(this.userDataSyncEnablementService.onDidChangeEnablement(enabled => this.onDidChangeEnablement(enabled)));
|
||||
this._register(this.authenticationService.onDidRegisterAuthenticationProvider(e => this.onDidRegisterAuthenticationProvider(e)));
|
||||
this._register(this.authenticationService.onDidUnregisterAuthenticationProvider(e => this.onDidUnregisterAuthenticationProvider(e)));
|
||||
@@ -540,13 +541,14 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
}
|
||||
});
|
||||
if (result.confirmed) {
|
||||
await this.disableSync();
|
||||
if (result.checkboxChecked) {
|
||||
this.telemetryService.publicLog2('sync/turnOffEveryWhere');
|
||||
await this.userDataSyncService.reset();
|
||||
} else {
|
||||
await this.userDataSyncService.resetLocal();
|
||||
}
|
||||
await this.signOut();
|
||||
this.disableSync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,7 +569,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
try {
|
||||
await this.setActiveAccount(await this.authenticationService.login(this.userDataSyncStore!.authenticationProviderId, ['https://management.core.windows.net/.default', 'offline_access']));
|
||||
} catch (e) {
|
||||
this.notificationService.error(e);
|
||||
this.notificationService.error(localize('loginFailed', "Logging in failed: {0}", e));
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -583,12 +585,12 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
const previewResource = source === SyncSource.Settings ? this.workbenchEnvironmentService.settingsSyncPreviewResource
|
||||
: source === SyncSource.Keybindings ? this.workbenchEnvironmentService.keybindingsSyncPreviewResource
|
||||
: null;
|
||||
return previewResource ? this.editorService.editors.filter(input => input instanceof DiffEditorInput && isEqual(previewResource, input.master.getResource()))[0] : undefined;
|
||||
return previewResource ? this.editorService.editors.filter(input => input instanceof DiffEditorInput && isEqual(previewResource, input.master.resource))[0] : undefined;
|
||||
}
|
||||
|
||||
private getAllConflictsEditorInputs(): IEditorInput[] {
|
||||
return this.editorService.editors.filter(input => {
|
||||
const resource = input instanceof DiffEditorInput ? input.master.getResource() : input.getResource();
|
||||
const resource = input instanceof DiffEditorInput ? input.master.resource : input.resource;
|
||||
return isEqual(resource, this.workbenchEnvironmentService.settingsSyncPreviewResource) || isEqual(resource, this.workbenchEnvironmentService.keybindingsSyncPreviewResource);
|
||||
});
|
||||
}
|
||||
@@ -671,7 +673,15 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
|
||||
});
|
||||
|
||||
const stopSyncCommandId = 'workbench.userData.actions.stopSync';
|
||||
CommandsRegistry.registerCommand(stopSyncCommandId, () => this.turnOff());
|
||||
CommandsRegistry.registerCommand(stopSyncCommandId, async () => {
|
||||
try {
|
||||
await this.turnOff();
|
||||
} catch (e) {
|
||||
if (!isPromiseCanceledError(e)) {
|
||||
this.notificationService.error(localize('turn off failed', "Error while turning off sync: {0}", toErrorMessage(e)));
|
||||
}
|
||||
}
|
||||
});
|
||||
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
||||
group: '5_sync',
|
||||
command: {
|
||||
|
||||
Reference in New Issue
Block a user