optimize<DiffViewer>: clear all old datas before update contents

This commit is contained in:
leo 2022-10-21 16:13:07 +08:00
parent c1c57f9b1d
commit 3667a89fb8

View file

@ -60,6 +60,10 @@ namespace SourceGit.Views.Widgets {
public void Diff(string repo, Option opt) { public void Diff(string repo, Option opt) {
seq++; seq++;
foreach (var e in editors) e.ItemsSource = null;
foreach (var s in splitters) s.Visibility = Visibility.Hidden;
ClearCache();
mask.Visibility = Visibility.Collapsed; mask.Visibility = Visibility.Collapsed;
noChange.Visibility = Visibility.Collapsed; noChange.Visibility = Visibility.Collapsed;
sizeChange.Visibility = Visibility.Collapsed; sizeChange.Visibility = Visibility.Collapsed;
@ -68,7 +72,6 @@ namespace SourceGit.Views.Widgets {
loading.IsAnimating = true; loading.IsAnimating = true;
SetTitle(opt.Path, opt.OrgPath); SetTitle(opt.Path, opt.OrgPath);
ClearCache();
this.repo = repo; this.repo = repo;
this.opt = opt; this.opt = opt;