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; _isLoadingData = true;
Unstaged = unstaged; Unstaged = unstaged;
Staged = staged; Staged = staged;
SelectedUnstaged = selectedUnstaged;
SelectedStaged = selectedStaged;
_isLoadingData = false; _isLoadingData = false;
if (selectedUnstaged.Count > 0) if (selectedUnstaged.Count == 1)
SelectedUnstaged = selectedUnstaged; SetDetail(selectedUnstaged[0]);
else if (selectedStaged.Count > 0) else if (selectedStaged.Count == 1)
SelectedStaged = selectedStaged; SetDetail(selectedStaged[0]);
else else
SetDetail(null); SetDetail(null);