mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -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;
|
get => _commits;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
var oldAutoSelectedCommitSHA = AutoSelectedCommit?.SHA;
|
||||||
if (SetProperty(ref _commits, value))
|
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;
|
Graph = null;
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue