Skip to content

Commit 26c6629

Browse files
committed
Reset clean status on Apply to avoid potential duplicate reparse.
1 parent 9c7816f commit 26c6629

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesViewModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static AddRemoveReferencesViewModel()
7676
}
7777

7878
public event EventHandler<DialogResult> OnWindowClosed;
79-
private void CloseWindowOk() => OnWindowClosed?.Invoke(this, DialogResult.OK);
79+
private void CloseWindowOk() => OnWindowClosed?.Invoke(this, IsProjectDirty ? DialogResult.OK : DialogResult.Cancel);
8080
private void CloseWindowCancel() => OnWindowClosed?.Invoke(this, DialogResult.Cancel);
8181

8282
private readonly List<(int?, ReferenceInfo)> _clean;
@@ -300,6 +300,11 @@ private void ExecuteApplyCommand(object parameter)
300300
}
301301

302302
Model.State.OnParseRequested(this);
303+
304+
_clean.Clear();
305+
_clean.AddRange(new List<(int?, ReferenceInfo)>(_project.Select(reference => (reference.Priority, reference.ToReferenceInfo()))));
306+
IsProjectDirty = false;
307+
303308
AvailableReferences.Refresh();
304309
ProjectReferences.Refresh();
305310
}

0 commit comments

Comments
 (0)