diff --git a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs index 7aa51e42b..41e283aba 100644 --- a/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs +++ b/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs @@ -83,6 +83,8 @@ public override void Initialize(IApplicationManager applicationManager) BranchesView.InitializeView(this); SettingsView.InitializeView(this); InitProjectView.InitializeView(this); + + titleContent = new GUIContent(Title, Styles.SmallLogo); } public override void OnEnable() @@ -92,9 +94,6 @@ public override void OnEnable() #if DEVELOPER_BUILD Selection.activeObject = this; #endif - // Set window title - titleContent = new GUIContent(Title, Styles.SmallLogo); - if (Repository != null) Repository.CheckCurrentBranchAndRemoteChangedEvent(lastCurrentBranchAndRemoteChangedEvent); @@ -112,8 +111,6 @@ public override void OnDisable() public override void OnDataUpdate() { base.OnDataUpdate(); - if (titleContent.image == null) - titleContent = new GUIContent(Title, Styles.SmallLogo); MaybeUpdateData(); if (ActiveView != null) @@ -189,7 +186,7 @@ private void MaybeUpdateData() if (Repository != null) { - if (currentBranchAndRemoteHasUpdate) + if (repoBranch == null || repoRemote == null || currentBranchAndRemoteHasUpdate) { var repositoryCurrentBranch = Repository.CurrentBranch; var updatedRepoBranch = repositoryCurrentBranch.HasValue ? repositoryCurrentBranch.Value.Name : null; @@ -244,13 +241,13 @@ private void MaybeUpdateData() } } - if (shouldUpdateContentFields) + if (shouldUpdateContentFields || repoBranchContent == null || repoUrlContent == null) { repoBranchContent = new GUIContent(repoBranch, Window_RepoBranchTooltip); - if (updatedRepoRemote != null) + if (repoRemote != null) { - repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, updatedRepoRemote)); + repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, repoRemote)); } else {