mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
Merge pull request #104 from gadfly3173/fix/keep-commit
fix: keep selected commit after _commits var reassigned
This commit is contained in:
commit
63248dafb5
1 changed files with 11 additions and 0 deletions
|
@ -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(() =>
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue