fix: SelectedUnstaged and SelectedStaged should always be re-calculated (#328)

This commit is contained in:
leo 2024-08-06 17:08:01 +08:00
parent f41f8266d2
commit e50db02ea8
No known key found for this signature in database

View file

@ -278,12 +278,14 @@ namespace SourceGit.ViewModels
_isLoadingData = true;
Unstaged = unstaged;
Staged = staged;
SelectedUnstaged = selectedUnstaged;
SelectedStaged = selectedStaged;
_isLoadingData = false;
if (selectedUnstaged.Count > 0)
SelectedUnstaged = selectedUnstaged;
else if (selectedStaged.Count > 0)
SelectedStaged = selectedStaged;
if (selectedUnstaged.Count == 1)
SetDetail(selectedUnstaged[0]);
else if (selectedStaged.Count == 1)
SetDetail(selectedStaged[0]);
else
SetDetail(null);