Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Tiny fixes with hostnames and web/api urls
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleyGoldman committed Oct 23, 2018
1 parent c7c9a15 commit 94d7fa1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/GitHub.Api/Application/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void LoginWithToken(string token, Action<bool> result)
Guard.ArgumentNotNull(result, "result");

new FuncTask<bool>(taskManager.Token,
() => loginManager.LoginWithToken(HostAddress.WebUri.Host, token))
() => loginManager.LoginWithToken(UriString.ToUriString(HostAddress.WebUri), token))
.FinallyInUI((success, ex, res) =>
{
if (!success)
Expand All @@ -279,7 +279,7 @@ public void LoginWithToken(string token, Action<bool> result)

public void CreateOAuthToken(string code, Action<bool, string> result)
{
var command = "token -h " + HostAddress.ApiUri.Host;
var command = "token -h " + HostAddress.WebUri.Host;
var octorunTask = new OctorunTask(taskManager.Token, environment, command, code)
.Configure(processManager);

Expand Down Expand Up @@ -388,7 +388,7 @@ private Connection Connection
{
if (connection == null)
{
connection = keychain.Connections.FirstOrDefault(x => x.Host == (UriString)HostAddress.WebUri.Host);
connection = keychain.Connections.FirstOrDefault(x => x.Host.ToUriString().Host == HostAddress.WebUri.Host);
}

return connection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private void OnOAuthCallback(string state, string code)
if (state.Equals(oAuthState))
{
isBusy = true;
authenticationService.LoginWithOAuthCode(code, DoOAuthCodeResult);
authenticationService.LoginWithOAuthCode(code, (b, s) => TaskManager.RunInUI(() => DoOAuthCodeResult(b, s)));
}
}

Expand Down Expand Up @@ -292,7 +292,7 @@ private AuthenticationService AuthenticationService
{
if (authenticationService == null)
{
AuthenticationService = new AuthenticationService(HostAddress.GitHubDotComHostAddress.WebUri.Host, Platform.Keychain, Manager.ProcessManager, Manager.TaskManager, Environment);
AuthenticationService = new AuthenticationService(UriString.ToUriString(HostAddress.GitHubDotComHostAddress.WebUri), Platform.Keychain, Manager.ProcessManager, Manager.TaskManager, Environment);
}
return authenticationService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ private void OnOAuthCallback(string state, string code)
if (state.Equals(oAuthState))
{
isBusy = true;
authenticationService.LoginWithOAuthCode(code, DoOAuthCodeResult);
authenticationService.LoginWithOAuthCode(code, (b, s) => TaskManager.RunInUI(() => DoOAuthCodeResult(b, s)));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void MaybeUpdateData()
{
connectionsNeedLoading = false;
connections = Platform.Keychain.Connections.OrderByDescending(HostAddress.IsGitHubDotCom).ToArray();
connectionLabels = connections.Select(c => HostAddress.IsGitHubDotCom(c) ? "GitHub" : c.Host).ToArray();
connectionLabels = connections.Select(c => HostAddress.IsGitHubDotCom(c) ? "GitHub" : c.Host.ToUriString().Host).ToArray();

var connection = connections.First();
selectedConnection = 0;
Expand Down

0 comments on commit 94d7fa1

Please sign in to comment.