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

Commit b3fd943

Browse files
Merge branch 'master' into fixes/application-cache-initial-times
2 parents d1f99de + c0012ba commit b3fd943

File tree

1 file changed

+6
-9
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/UI

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public override void Initialize(IApplicationManager applicationManager)
8383
BranchesView.InitializeView(this);
8484
SettingsView.InitializeView(this);
8585
InitProjectView.InitializeView(this);
86+
87+
titleContent = new GUIContent(Title, Styles.SmallLogo);
8688
}
8789

8890
public override void OnEnable()
@@ -92,9 +94,6 @@ public override void OnEnable()
9294
#if DEVELOPER_BUILD
9395
Selection.activeObject = this;
9496
#endif
95-
// Set window title
96-
titleContent = new GUIContent(Title, Styles.SmallLogo);
97-
9897
if (Repository != null)
9998
Repository.CheckCurrentBranchAndRemoteChangedEvent(lastCurrentBranchAndRemoteChangedEvent);
10099

@@ -112,8 +111,6 @@ public override void OnDisable()
112111
public override void OnDataUpdate()
113112
{
114113
base.OnDataUpdate();
115-
if (titleContent.image == null)
116-
titleContent = new GUIContent(Title, Styles.SmallLogo);
117114
MaybeUpdateData();
118115

119116
if (ActiveView != null)
@@ -189,7 +186,7 @@ private void MaybeUpdateData()
189186

190187
if (Repository != null)
191188
{
192-
if (currentBranchAndRemoteHasUpdate)
189+
if (repoBranch == null || repoRemote == null || currentBranchAndRemoteHasUpdate)
193190
{
194191
var repositoryCurrentBranch = Repository.CurrentBranch;
195192
var updatedRepoBranch = repositoryCurrentBranch.HasValue ? repositoryCurrentBranch.Value.Name : null;
@@ -244,13 +241,13 @@ private void MaybeUpdateData()
244241
}
245242
}
246243

247-
if (shouldUpdateContentFields)
244+
if (shouldUpdateContentFields || repoBranchContent == null || repoUrlContent == null)
248245
{
249246
repoBranchContent = new GUIContent(repoBranch, Window_RepoBranchTooltip);
250247

251-
if (updatedRepoRemote != null)
248+
if (repoRemote != null)
252249
{
253-
repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, updatedRepoRemote));
250+
repoUrlContent = new GUIContent(repoUrl, string.Format(Window_RepoUrlTooltip, repoRemote));
254251
}
255252
else
256253
{

0 commit comments

Comments
 (0)