optimize<WorkingCopy>: clear LastViewChange first before re-assign it

This commit is contained in:
leo 2021-01-06 12:01:02 +08:00
parent fcec38b7e7
commit f944ded171

View file

@ -210,6 +210,7 @@ namespace SourceGit.UI {
var selected = Helpers.TreeViewHelper.GetSelectedItems(unstagedTree); var selected = Helpers.TreeViewHelper.GetSelectedItems(unstagedTree);
if (selected.Count == 0) return; if (selected.Count == 0) return;
LastViewChange = null;
mergePanel.Visibility = Visibility.Collapsed; mergePanel.Visibility = Visibility.Collapsed;
diffViewer.Reset(); diffViewer.Reset();
Helpers.TreeViewHelper.UnselectTree(stageTree); Helpers.TreeViewHelper.UnselectTree(stageTree);
@ -245,6 +246,7 @@ namespace SourceGit.UI {
var selected = unstagedList.SelectedItems; var selected = unstagedList.SelectedItems;
if (selected.Count == 0) return; if (selected.Count == 0) return;
LastViewChange = null;
mergePanel.Visibility = Visibility.Collapsed; mergePanel.Visibility = Visibility.Collapsed;
diffViewer.Reset(); diffViewer.Reset();
Helpers.TreeViewHelper.UnselectTree(stageTree); Helpers.TreeViewHelper.UnselectTree(stageTree);
@ -619,6 +621,7 @@ namespace SourceGit.UI {
var selected = Helpers.TreeViewHelper.GetSelectedItems(stageTree); var selected = Helpers.TreeViewHelper.GetSelectedItems(stageTree);
if (selected.Count == 0) return; if (selected.Count == 0) return;
LastViewChange = null;
mergePanel.Visibility = Visibility.Collapsed; mergePanel.Visibility = Visibility.Collapsed;
diffViewer.Reset(); diffViewer.Reset();
Helpers.TreeViewHelper.UnselectTree(unstagedTree); Helpers.TreeViewHelper.UnselectTree(unstagedTree);
@ -643,6 +646,7 @@ namespace SourceGit.UI {
var selected = stageList.SelectedItems; var selected = stageList.SelectedItems;
if (selected.Count == 0) return; if (selected.Count == 0) return;
LastViewChange = null;
mergePanel.Visibility = Visibility.Collapsed; mergePanel.Visibility = Visibility.Collapsed;
diffViewer.Reset(); diffViewer.Reset();
Helpers.TreeViewHelper.UnselectTree(unstagedTree); Helpers.TreeViewHelper.UnselectTree(unstagedTree);