Skip to content

Commit

Permalink
use current profile (microsoft#170116)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 authored Dec 27, 2022
1 parent c637ec1 commit 20c8c98
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/use
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { ctxIsMergeResultEditor, ctxMergeBaseUri } from 'vs/workbench/contrib/mergeEditor/common/mergeEditor';
import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue';
import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile';

type ConfigureSyncQuickPickItem = { id: SyncResource; label: string; description?: string };

Expand Down Expand Up @@ -101,6 +102,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
@INotificationService private readonly notificationService: INotificationService,
@IEditorService private readonly editorService: IEditorService,
@IUserDataProfilesService private readonly userDataProfilesService: IUserDataProfilesService,
@IUserDataProfileService private readonly userDataProfileService: IUserDataProfileService,
@IDialogService private readonly dialogService: IDialogService,
@IQuickInputService private readonly quickInputService: IQuickInputService,
@IInstantiationService private readonly instantiationService: IInstantiationService,
Expand Down Expand Up @@ -392,8 +394,11 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
if (!this.hostService.hasFocus) {
return;
}
const resource = source === SyncResource.Settings ? this.userDataProfilesService.defaultProfile.settingsResource : this.userDataProfilesService.defaultProfile.keybindingsResource;
if (isEqual(resource, EditorResourceAccessor.getCanonicalUri(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.PRIMARY }))) {
const resource = source === SyncResource.Settings ? this.userDataProfileService.currentProfile.settingsResource
: source === SyncResource.Keybindings ? this.userDataProfileService.currentProfile.keybindingsResource
: this.userDataProfileService.currentProfile.tasksResource;
const editorUri = EditorResourceAccessor.getCanonicalUri(this.editorService.activeEditor, { supportSideBySide: SideBySideEditor.PRIMARY });
if (isEqual(resource, editorUri)) {
// Do not show notification if the file in error is active
return;
}
Expand Down

0 comments on commit 20c8c98

Please sign in to comment.