Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix conflicts action badge #194805

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo

private readonly conflictsDisposables = new Map<string, IDisposable>();
private onDidChangeConflicts(conflicts: IUserDataSyncResourceConflicts[]) {
this.updateGlobalActivityBadge();
this.registerShowConflictsAction();
if (!this.userDataSyncEnablementService.isEnabled()) {
return;
}
this.updateGlobalActivityBadge();
if (conflicts.length) {
// Clear and dispose conflicts those were cleared
for (const [key, disposable] of this.conflictsDisposables.entries()) {
Expand Down Expand Up @@ -836,9 +837,10 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
return { value: localize('resolveConflicts_global', "Show Conflicts ({0})", this.getConflictsCount()), original: `Show Conflicts (${this.getConflictsCount()})` };
}

private conflictsActionDisposable = this._register(new MutableDisposable());
private registerShowConflictsAction(): void {
const that = this;
this._register(registerAction2(class TurningOnSyncAction extends Action2 {
this.conflictsActionDisposable.value = registerAction2(class TurningOnSyncAction extends Action2 {
constructor() {
super({
id: showConflictsCommandId,
Expand All @@ -862,7 +864,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
async run(): Promise<any> {
return that.userDataSyncWorkbenchService.showConflicts();
}
}));
});
}

private registerManageSyncAction(): void {
Expand Down