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

Commit 9dd153c

Browse files
committed
Fix logging out not logging out properly
1 parent ad28118 commit 9dd153c

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

src/GitHub.Api/Primitives/UriString.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static string GetSerializedValue(SerializationInfo info)
267267

268268
static string NormalizePath(string path)
269269
{
270-
return path?.Replace('\\', '/');
270+
return path?.Replace('\\', '/').TrimEnd('/');
271271
}
272272

273273
static string GetRepositoryName(string repositoryNameSegment)

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -551,18 +551,6 @@ private void DoToolbarGUI()
551551
}
552552

553553
GUILayout.FlexibleSpace();
554-
555-
if (connection == null)
556-
{
557-
if (GUILayout.Button("Sign in", Styles.HistoryToolbarButtonStyle))
558-
SignIn(null);
559-
}
560-
else
561-
{
562-
if (GUILayout.Button(connection.Username, EditorStyles.toolbarDropDown))
563-
{
564-
DoAccountDropdown();
565-
}
566554
}
567555
EditorGUILayout.EndHorizontal();
568556
}
@@ -632,8 +620,18 @@ private void DoActionbarGUI()
632620

633621
GUILayout.FlexibleSpace();
634622

635-
if (GUILayout.Button(Localization.AccountButton, EditorStyles.toolbarDropDown))
636-
DoAccountDropdown();
623+
if (connection == null)
624+
{
625+
if (GUILayout.Button("Sign in", EditorStyles.toolbarButton))
626+
SignIn(null);
627+
}
628+
else
629+
{
630+
if (GUILayout.Button(connection.Username, EditorStyles.toolbarDropDown))
631+
{
632+
DoAccountDropdown();
633+
}
634+
}
637635
}
638636
EditorGUILayout.EndHorizontal();
639637
}
@@ -823,15 +821,15 @@ private void SignOut(object obj)
823821
if (Repository != null && Repository.CloneUrl != null && Repository.CloneUrl.IsValidUri)
824822
{
825823
host = new UriString(Repository.CloneUrl.ToRepositoryUri()
826-
.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
824+
.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
827825
}
828826
else
829827
{
830828
host = UriString.ToUriString(HostAddress.GitHubDotComHostAddress.WebUri);
831829
}
832830

833831
var apiClient = new ApiClient(host, Platform.Keychain, null, null, NPath.Default, NPath.Default);
834-
apiClient.Logout(host);
832+
apiClient.Logout(host).FinallyInUI((s, e) => Redraw());
835833
}
836834

837835
public new void ShowNotification(GUIContent content)

0 commit comments

Comments
 (0)