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

Commit f5de9ca

Browse files
authored
Merge branch 'master' into fixes/publish-view-placeholder
2 parents 663d095 + 618540a commit f5de9ca

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ class PublishView : Subview
1111
private const string Title = "Publish this repository to GitHub";
1212
private const string PrivateRepoMessage = "You choose who can see and commit to this repository";
1313
private const string PublicRepoMessage = "Anyone can see this repository. You choose who can commit";
14-
private const string PublishViewCreateButton = "Create";
14+
private const string PublishViewCreateButton = "Publish";
15+
private const string OwnersDefaultText = "Select a user or org";
1516

1617
[SerializeField] private string username;
17-
[SerializeField] private string[] owners = { };
18+
[SerializeField] private string[] owners = { OwnersDefaultText };
1819
[SerializeField] private int selectedOwner;
1920
[SerializeField] private string repoName = String.Empty;
2021
[SerializeField] private string repoDescription = "";
@@ -70,7 +71,7 @@ private void PopulateView()
7071
return;
7172
}
7273

73-
owners = new[] { user.Login };
74+
owners = owners.Union(new[] { user.Login }).ToArray();
7475
username = user.Login;
7576

7677
Logger.Trace("GetOrganizations");
@@ -134,7 +135,7 @@ public override void OnGUI()
134135
GUILayout.Label("Owner");
135136

136137
GUI.enabled = !isBusy;
137-
selectedOwner = EditorGUILayout.Popup(0, owners);
138+
selectedOwner = EditorGUILayout.Popup(selectedOwner, owners);
138139
GUI.enabled = true;
139140
}
140141
GUILayout.EndVertical();
@@ -194,7 +195,7 @@ public override void OnGUI()
194195
GUILayout.BeginHorizontal();
195196
{
196197
GUILayout.FlexibleSpace();
197-
GUI.enabled = !string.IsNullOrEmpty(repoName) && !isBusy;
198+
GUI.enabled = !string.IsNullOrEmpty(repoName) && !isBusy && selectedOwner != 0;
198199
if (GUILayout.Button(PublishViewCreateButton))
199200
{
200201
isBusy = true;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ public override void OnRepositoryChanged(IRepository oldRepository)
124124
public override void Refresh()
125125
{
126126
base.Refresh();
127-
if (Repository != null)
127+
if (Repository != null && Repository.CurrentRemote.HasValue)
128+
{
128129
Repository.ListLocks().Start();
130+
}
129131
}
130132

131133
private void AttachHandlers(IRepository repository)

0 commit comments

Comments
 (0)