Clear previous sync action before registering a new one in GitSyncCon… (#298898)

Clear previous sync action before registering a new one in GitSyncContribution
This commit is contained in:
Benjamin Christopher Simmonds
2026-03-04 22:45:34 +01:00
committed by GitHub
parent 49b4ea3cf6
commit 1b44525f0e

View File

@@ -73,6 +73,7 @@ class GitSyncContribution extends Disposable implements IWorkbenchContribution {
const behind = head.behind ?? 0;
const hasSyncChanges = ahead > 0 || behind > 0;
contextKey.set(hasSyncChanges);
this._syncActionDisposable.clear();
this._syncActionDisposable.value = registerSyncAction(behind, ahead, isSyncing, (syncing) => {
this._isSyncing.set(syncing, undefined);
});