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

Commit 6e31048

Browse files
committed
Serialize isPublished and currentRemote in the view
1 parent f5de9ca commit 6e31048

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class HistoryView : Subview
6161
[SerializeField] private ChangesetTreeView changesetTree = new ChangesetTreeView();
6262
[SerializeField] private List<GitLogEntry> history = new List<GitLogEntry>();
6363
[SerializeField] private bool isBusy;
64+
[SerializeField] private string currentRemote;
65+
[SerializeField] private bool isPublished;
6466

6567
public override void InitializeView(IView parent)
6668
{
@@ -222,6 +224,9 @@ private void OnLogUpdate(List<GitLogEntry> entries)
222224

223225
private void MaybeUpdateData()
224226
{
227+
isPublished = Repository.CurrentRemote.HasValue;
228+
currentRemote = isPublished ? Repository.CurrentRemote.Value.Name : "placeholder";
229+
225230
if (!updated)
226231
return;
227232
updated = false;
@@ -345,11 +350,8 @@ public void OnEmbeddedGUI()
345350

346351
GUILayout.FlexibleSpace();
347352

348-
349-
var isPublished = Repository.CurrentRemote.HasValue;
350353
if (isPublished)
351354
{
352-
var currentRemote = Repository.CurrentRemote.Value.Name;
353355
GUI.enabled = currentRemote != null;
354356
var fetchClicked = GUILayout.Button(FetchButtonText, Styles.HistoryToolbarButtonStyle);
355357
GUI.enabled = true;

0 commit comments

Comments
 (0)