mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 19:02:39 +08:00
fix: keep selected commit after _commits var reassigned
This commit is contained in:
@@ -34,8 +34,19 @@ namespace SourceGit.ViewModels
|
||||
get => _commits;
|
||||
set
|
||||
{
|
||||
var oldAutoSelectedCommitSHA = AutoSelectedCommit?.SHA;
|
||||
if (SetProperty(ref _commits, value))
|
||||
{
|
||||
Models.Commit newSelectedCommit = null;
|
||||
if (value.Count > 0 && oldAutoSelectedCommitSHA != null)
|
||||
{
|
||||
newSelectedCommit = value.Find(x => x.SHA == oldAutoSelectedCommitSHA);
|
||||
}
|
||||
if (newSelectedCommit != AutoSelectedCommit)
|
||||
{
|
||||
AutoSelectedCommit = newSelectedCommit;
|
||||
}
|
||||
|
||||
Graph = null;
|
||||
Task.Run(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user