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

Commit 5aa8092

Browse files
Clearing the message at the right time
1 parent 3e4e699 commit 5aa8092

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ class AuthenticationView : Subview
2121
private const string TwofaButton = "Verify";
2222

2323
[SerializeField] private Vector2 scroll;
24-
[SerializeField] private string username = "";
25-
[SerializeField] private string two2fa = "";
24+
[SerializeField] private string username = string.Empty;
25+
[SerializeField] private string two2fa = string.Empty;
2626
[SerializeField] private string message;
2727

2828
[NonSerialized] private bool need2fa;
2929
[NonSerialized] private bool isBusy;
3030
[NonSerialized] private string errorMessage;
3131
[NonSerialized] private bool enterPressed;
32-
[NonSerialized] private string password = "";
32+
[NonSerialized] private string password = string.Empty;
3333
[NonSerialized] private AuthenticationService authenticationService;
3434

3535

@@ -104,11 +104,21 @@ public void SetMessage(string value)
104104
message = value;
105105
}
106106

107+
public void ClearMessage()
108+
{
109+
message = null;
110+
}
111+
107112
public void SetUsername(string value)
108113
{
109114
username = value;
110115
}
111116

117+
public void ClearUsername()
118+
{
119+
username = string.Empty;
120+
}
121+
112122
private void HandleEnterPressed()
113123
{
114124
if (Event.current.type != EventType.KeyDown)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ private void Open(PopupViewType popupViewType, Action<bool> onClose)
8383
}
8484

8585
OpenInternal(PopupViewType.AuthenticationView, completedAuthentication => {
86+
authenticationView.ClearMessage();
87+
authenticationView.ClearUsername();
88+
8689
if (completedAuthentication)
8790
{
8891
Logger.Trace("User completed validation opening view: {0}", popupViewType.ToString());

0 commit comments

Comments
 (0)