mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 19:02:39 +08:00
ux: avoid revision file tree view flickering when selecting another commit
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -247,12 +247,12 @@ namespace SourceGit.Views
|
||||
if (change.Property == RevisionProperty)
|
||||
{
|
||||
_tree.Clear();
|
||||
Rows.Clear();
|
||||
_searchResult.Clear();
|
||||
|
||||
var vm = DataContext as ViewModels.CommitDetail;
|
||||
if (vm?.Commit == null)
|
||||
{
|
||||
Rows.Clear();
|
||||
GC.Collect();
|
||||
return;
|
||||
}
|
||||
@@ -260,6 +260,7 @@ namespace SourceGit.Views
|
||||
var objects = await vm.GetRevisionFilesUnderFolderAsync(null);
|
||||
if (objects == null || objects.Count == 0)
|
||||
{
|
||||
Rows.Clear();
|
||||
GC.Collect();
|
||||
return;
|
||||
}
|
||||
@@ -271,6 +272,8 @@ namespace SourceGit.Views
|
||||
|
||||
var topTree = new List<ViewModels.RevisionFileTreeNode>();
|
||||
MakeRows(topTree, _tree, 0);
|
||||
|
||||
Rows.Clear();
|
||||
Rows.AddRange(topTree);
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user