From 2e433aa278da3922fc54a5e7f05d2e1edadec1c0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 6 Aug 2024 14:36:58 +0800 Subject: [PATCH] refactor: set detail directly instead of reset selected changes --- src/ViewModels/WorkingCopy.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index e1bbac4d..faebfc5f 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -223,10 +223,10 @@ namespace SourceGit.ViewModels // Just force refresh selected changes. Dispatcher.UIThread.Invoke(() => { - if (_selectedUnstaged.Count > 0) - SelectedUnstaged = new List(_selectedUnstaged); - else if (_selectedStaged.Count > 0) - SelectedStaged = new List(_selectedStaged); + if (_selectedUnstaged.Count == 1) + SetDetail(_selectedUnstaged[0]); + else if (_selectedStaged.Count == 1) + SetDetail(_selectedStaged[0]); }); return _cached.Find(x => x.IsConflit) != null;