From b2b22da1861acf0324e3dba8b3e79483c2d7e694 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 17 Sep 2018 14:47:47 -0400 Subject: [PATCH 1/3] Correcting statement to check status of initialization --- .../Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs index d228a361e..95cdd8043 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs @@ -26,7 +26,7 @@ class ProjectWindowInterface : AssetPostprocessor private static CacheUpdateEvent lastRepositoryStatusChangedEvent; private static CacheUpdateEvent lastLocksChangedEvent; private static IRepository Repository { get { return manager != null ? manager.Environment.Repository : null; } } - private static bool IsInitialized { get { return Repository != null && Repository.CurrentRemote.HasValue; } } + private static bool IsInitialized { get { return Repository != null; } } public static void Initialize(IApplicationManager theManager) { From 09102c31ac092720e5390f774eff8217c51b5336 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Mon, 17 Sep 2018 15:12:18 -0400 Subject: [PATCH 2/3] Refreshing the asset database on status entry changed events --- .../Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs index 95cdd8043..8a6291439 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs @@ -67,6 +67,7 @@ private static void RepositoryOnStatusEntriesChanged(CacheUpdateEvent cacheUpdat if (!lastRepositoryStatusChangedEvent.Equals(cacheUpdateEvent)) { lastRepositoryStatusChangedEvent = cacheUpdateEvent; + AssetDatabase.Refresh(); entries.Clear(); entries.AddRange(Repository.CurrentChanges); OnStatusUpdate(); From 76c55e2da29fb4c28a5263eb09d765ecc89bec20 Mon Sep 17 00:00:00 2001 From: Stanley Goldman Date: Tue, 2 Oct 2018 16:23:48 -0400 Subject: [PATCH 3/3] Fixing the enable/disable of context menus --- .../Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs index 8a6291439..0a0106267 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs @@ -89,6 +89,8 @@ private static bool ContextMenu_CanLock() { if (!EnsureInitialized()) return false; + if(!Repository.CurrentRemote.HasValue) + return false; if (isBusy) return false; return Selection.objects.Any(IsObjectUnlocked); @@ -99,6 +101,8 @@ private static bool ContextMenu_CanUnlock() { if (!EnsureInitialized()) return false; + if (!Repository.CurrentRemote.HasValue) + return false; if (isBusy) return false; return Selection.objects.Any(IsObjectLocked); @@ -109,6 +113,8 @@ private static bool ContextMenu_CanUnlockForce() { if (!EnsureInitialized()) return false; + if (!Repository.CurrentRemote.HasValue) + return false; if (isBusy) return false; return Selection.objects.Any(IsObjectLocked);