From 3667a89fb868c894a718b6a920f8051cb08c493f Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 21 Oct 2022 16:13:07 +0800 Subject: [PATCH] optimize: clear all old datas before update contents --- src/Views/Widgets/DiffViewer.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Views/Widgets/DiffViewer.xaml.cs b/src/Views/Widgets/DiffViewer.xaml.cs index e63a0280..32de1d78 100644 --- a/src/Views/Widgets/DiffViewer.xaml.cs +++ b/src/Views/Widgets/DiffViewer.xaml.cs @@ -60,6 +60,10 @@ namespace SourceGit.Views.Widgets { public void Diff(string repo, Option opt) { seq++; + foreach (var e in editors) e.ItemsSource = null; + foreach (var s in splitters) s.Visibility = Visibility.Hidden; + ClearCache(); + mask.Visibility = Visibility.Collapsed; noChange.Visibility = Visibility.Collapsed; sizeChange.Visibility = Visibility.Collapsed; @@ -68,7 +72,6 @@ namespace SourceGit.Views.Widgets { loading.IsAnimating = true; SetTitle(opt.Path, opt.OrgPath); - ClearCache(); this.repo = repo; this.opt = opt;