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

Commit d6fcd33

Browse files
Merge pull request #911 from github-for-unity/fixes/project-window-interface-initialized
Project Window Interface Fixes
2 parents 14bab1c + 7b7c5e5 commit d6fcd33

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ProjectWindowInterface : AssetPostprocessor
2626
private static CacheUpdateEvent lastRepositoryStatusChangedEvent;
2727
private static CacheUpdateEvent lastLocksChangedEvent;
2828
private static IRepository Repository { get { return manager != null ? manager.Environment.Repository : null; } }
29-
private static bool IsInitialized { get { return Repository != null && Repository.CurrentRemote.HasValue; } }
29+
private static bool IsInitialized { get { return Repository != null; } }
3030

3131
public static void Initialize(IApplicationManager theManager)
3232
{
@@ -67,6 +67,7 @@ private static void RepositoryOnStatusEntriesChanged(CacheUpdateEvent cacheUpdat
6767
if (!lastRepositoryStatusChangedEvent.Equals(cacheUpdateEvent))
6868
{
6969
lastRepositoryStatusChangedEvent = cacheUpdateEvent;
70+
AssetDatabase.Refresh();
7071
entries.Clear();
7172
entries.AddRange(Repository.CurrentChanges);
7273
OnStatusUpdate();
@@ -88,6 +89,8 @@ private static bool ContextMenu_CanLock()
8889
{
8990
if (!EnsureInitialized())
9091
return false;
92+
if(!Repository.CurrentRemote.HasValue)
93+
return false;
9194
if (isBusy)
9295
return false;
9396
return Selection.objects.Any(IsObjectUnlocked);
@@ -98,6 +101,8 @@ private static bool ContextMenu_CanUnlock()
98101
{
99102
if (!EnsureInitialized())
100103
return false;
104+
if (!Repository.CurrentRemote.HasValue)
105+
return false;
101106
if (isBusy)
102107
return false;
103108
return Selection.objects.Any(IsObjectLocked);
@@ -108,6 +113,8 @@ private static bool ContextMenu_CanUnlockForce()
108113
{
109114
if (!EnsureInitialized())
110115
return false;
116+
if (!Repository.CurrentRemote.HasValue)
117+
return false;
111118
if (isBusy)
112119
return false;
113120
return Selection.objects.Any(IsObjectLocked);

0 commit comments

Comments
 (0)