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

Commit b886e52

Browse files
committed
Merge branch 'refactor/mvvm' into fixes/1360-dispose-pane-pages
Conflicts: src/GitHub.App/ViewModels/GitHubPane/PullRequestDetailViewModel.cs
2 parents 6f95f8d + 2eb687c commit b886e52

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/GitHub.App/ViewModels/GitHubPane/PullRequestDetailViewModel.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using GitHub.App;
1212
using GitHub.Extensions;
1313
using GitHub.Factories;
14+
using GitHub.Helpers;
1415
using GitHub.Logging;
1516
using GitHub.Models;
1617
using GitHub.Services;
@@ -511,15 +512,23 @@ protected override void Dispose(bool disposing)
511512
}
512513
}
513514

514-
void ActiveRepositoriesChanged()
515+
async void ActiveRepositoriesChanged()
515516
{
516-
if (active)
517+
try
517518
{
518-
Refresh().Forget();
519+
if (active)
520+
{
521+
await ThreadingHelper.SwitchToMainThreadAsync();
522+
await Refresh();
523+
}
524+
else
525+
{
526+
refreshOnActivate = true;
527+
}
519528
}
520-
else
529+
catch (Exception ex)
521530
{
522-
refreshOnActivate = true;
531+
log.Error(ex, "Error refreshing in ActiveRepositoriesChanged.");
523532
}
524533
}
525534

0 commit comments

Comments
 (0)