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

Commit 74c80c2

Browse files
committed
Always default to GitHub login
1 parent 6295d83 commit 74c80c2

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/GitHub.App/ViewModels/Dialog/LoginCredentialsViewModel.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System;
22
using System.ComponentModel.Composition;
33
using System.Reactive.Linq;
4-
using GitHub.App;
5-
using GitHub.Primitives;
64
using GitHub.Services;
75
using 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
}

0 commit comments

Comments
 (0)