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

Commit 14f0027

Browse files
committed
Compare IPullRequestModel by ref in setter.
PullRequestModel overrides Equals such that two PRs with the same number are considered equal. This was causing the Model not to be updated on refresh: we need to use ReferenceEquals. Fixes #901
1 parent d97c90c commit 14f0027

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)