This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
src/GitHub.InlineReviews/Services Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 33using System . Windows . Input ;
44using System . Windows . Controls ;
55using System . Windows . Controls . Primitives ;
6- using System . ComponentModel ;
76using System . ComponentModel . Composition ;
87using GitHub . InlineReviews . Views ;
98using GitHub . InlineReviews . ViewModels ;
1312using GitHub . Logging ;
1413using GitHub . Extensions ;
1514using Serilog ;
15+ using ReactiveUI ;
1616
1717namespace GitHub . InlineReviews . Services
1818{
@@ -39,24 +39,15 @@ public void StartShowingStatus()
3939 {
4040 // Create just in time on Main thread.
4141 pullRequestSessionManager = serviceProvider . GetService < IPullRequestSessionManager > ( ) ;
42-
43- RefreshCurrentSession ( ) ;
44- pullRequestSessionManager . PropertyChanged += PullRequestSessionManager_PropertyChanged ;
42+ pullRequestSessionManager . WhenAnyValue ( x => x . CurrentSession )
43+ . Subscribe ( x => RefreshCurrentSession ( ) ) ;
4544 }
4645 catch ( Exception e )
4746 {
4847 log . Error ( e , "Error initializing" ) ;
4948 }
5049 }
5150
52- void PullRequestSessionManager_PropertyChanged ( object sender , PropertyChangedEventArgs e )
53- {
54- if ( e . PropertyName == nameof ( PullRequestSessionManager . CurrentSession ) )
55- {
56- RefreshCurrentSession ( ) ;
57- }
58- }
59-
6051 void RefreshCurrentSession ( )
6152 {
6253 var pullRequest = pullRequestSessionManager . CurrentSession ? . PullRequest ;
You can’t perform that action at this time.
0 commit comments