Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 1052168

Browse files
authored
Merge pull request #903 from github/fixes/901-pr-diff-wrong-version
Fix update in PR details view.
2 parents d97c90c + 14f0027 commit 1052168

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/GitHub.App/ViewModels/PullRequestDetailViewModel.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,18 @@ public PullRequestDetailViewModel(
113113
public IPullRequestModel Model
114114
{
115115
get { return model; }
116-
private set { this.RaiseAndSetIfChanged(ref model, value); }
116+
private set
117+
{
118+
// PullRequestModel overrides Equals such that two PRs with the same number are
119+
// considered equal. This was causing the Model not to be updated on refresh:
120+
// we need to use ReferenceEquals.
121+
if (!ReferenceEquals(model, value))
122+
{
123+
this.RaisePropertyChanging(nameof(Model));
124+
model = value;
125+
this.RaisePropertyChanged(nameof(Model));
126+
}
127+
}
117128
}
118129

119130
/// <summary>

0 commit comments

Comments
 (0)