Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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);

Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down