mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-05-01 06:15:41 +08:00
fix: text diff view in commit detail panel may display wrong data when switching between repositories (#1503)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -184,7 +184,7 @@ namespace SourceGit.ViewModels
|
||||
{
|
||||
var baseHead = new Commands.QuerySingleCommit(_repo, _based.Head).Result();
|
||||
var toHead = new Commands.QuerySingleCommit(_repo, _to.Head).Result();
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
BaseHead = baseHead;
|
||||
ToHead = toHead;
|
||||
@@ -204,7 +204,15 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
Dispatcher.UIThread.Invoke(() => VisibleChanges = visible);
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
VisibleChanges = visible;
|
||||
|
||||
if (VisibleChanges.Count > 0)
|
||||
SelectedChanges = [VisibleChanges[0]];
|
||||
else
|
||||
SelectedChanges = [];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -772,6 +772,8 @@ namespace SourceGit.ViewModels
|
||||
|
||||
if (visible.Count == 0)
|
||||
SelectedChanges = null;
|
||||
else
|
||||
SelectedChanges = [VisibleChanges[0]];
|
||||
});
|
||||
}
|
||||
}, token);
|
||||
|
||||
@@ -227,7 +227,15 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
Dispatcher.UIThread.Invoke(() => VisibleChanges = visible);
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
VisibleChanges = visible;
|
||||
|
||||
if (VisibleChanges.Count > 0)
|
||||
SelectedChanges = [VisibleChanges[0]];
|
||||
else
|
||||
SelectedChanges = [];
|
||||
});
|
||||
}
|
||||
|
||||
private string GetSHA(object obj)
|
||||
|
||||
Reference in New Issue
Block a user