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

Commit 23498ce

Browse files
Turning messages into constants; Changing account refresh message
1 parent 3ce244a commit 23498ce

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ namespace GitHub.Unity
77
[Serializable]
88
class PopupWindow : BaseWindow
99
{
10+
private const string CredentialsNeedRefreshMessage = "We've detected that your stored credentials are out of sync with your current user. This can happen if you have signed in to git outside of Unity. Sign in again to refresh your credentials.";
11+
private const string NeedAuthenticationMessage = "We need you to authenticate first";
12+
private const string AccountValidationErrorMessage = "There was an error validating your account";
13+
1014
public enum PopupViewType
1115
{
1216
None,
@@ -67,19 +71,19 @@ private void Open(PopupViewType popupViewType, Action<bool> onClose)
6771
var usernameMismatchException = exception as TokenUsernameMismatchException;
6872
if (usernameMismatchException != null)
6973
{
70-
message = "Your credentials need to be refreshed";
74+
message = CredentialsNeedRefreshMessage;
7175
username = usernameMismatchException.CachedUsername;
7276
}
7377

7478
var keychainEmptyException = exception as KeychainEmptyException;
7579
if (keychainEmptyException != null)
7680
{
77-
message = "We need you to authenticate first";
81+
message = NeedAuthenticationMessage;
7882
}
7983

8084
if (usernameMismatchException == null && keychainEmptyException == null)
8185
{
82-
message = "There was an error validating your account";
86+
message = AccountValidationErrorMessage;
8387
}
8488

8589
OpenInternal(PopupViewType.AuthenticationView, completedAuthentication => {

0 commit comments

Comments
 (0)