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 +1
-20
lines changed
src/GitHub.App/ViewModels/Dialog Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . ComponentModel . Composition ;
33using System . Reactive . Linq ;
4- using GitHub . App ;
5- using GitHub . Primitives ;
64using GitHub . Services ;
75using ReactiveUI ;
86
@@ -28,8 +26,7 @@ public LoginCredentialsViewModel(
2826 ( x , y ) => x . Value || y . Value
2927 ) . ToProperty ( this , vm => vm . IsLoginInProgress ) ;
3028
31- UpdateLoginMode ( ) ;
32- connectionManager . Connections . CollectionChanged += ( _ , __ ) => UpdateLoginMode ( ) ;
29+ LoginMode = LoginMode . DotComOrEnterprise ;
3330
3431 Done = Observable . Merge (
3532 loginToGitHubViewModel . Login ,
@@ -55,21 +52,5 @@ public LoginMode LoginMode
5552 public bool IsLoginInProgress { get { return isLoginInProgress . Value ; } }
5653
5754 public IObservable < object > Done { get ; }
58-
59- void UpdateLoginMode ( )
60- {
61- var result = LoginMode . DotComOrEnterprise ;
62-
63- foreach ( var connection in ConnectionManager . Connections )
64- {
65- if ( connection . IsLoggedIn )
66- {
67- result &= ~ ( ( connection . HostAddress == HostAddress . GitHubDotComHostAddress ) ?
68- LoginMode . DotComOnly : LoginMode . EnterpriseOnly ) ;
69- }
70- }
71-
72- LoginMode = result ;
73- }
7455 }
7556}
You can’t perform that action at this time.
0 commit comments