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

Commit 34451c1

Browse files
Merge pull request #505 from github-for-unity/fixes/changes-view-reload
Changes view reload
2 parents 4c2bbc7 + a946adb commit 34451c1

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ChangesView : Subview
1818
private const string NoChangedFilesLabel = "No changed files";
1919

2020
[NonSerialized] private bool currentBranchHasUpdate;
21-
[NonSerialized] private bool currentStatusHasUpdate;
21+
[NonSerialized] private bool currentStatusEntriesHasUpdate;
2222
[NonSerialized] private bool isBusy;
2323

2424
[SerializeField] private string commitBody = "";
@@ -40,11 +40,9 @@ public override void OnEnable()
4040
base.OnEnable();
4141
AttachHandlers(Repository);
4242

43-
if (Repository != null)
44-
{
45-
Repository.CheckCurrentBranchChangedEvent(lastCurrentBranchChangedEvent);
46-
Repository.CheckStatusEntriesChangedEvent(lastStatusEntriesChangedEvent);
47-
}
43+
Repository.CheckCurrentBranchChangedEvent(lastCurrentBranchChangedEvent);
44+
45+
currentStatusEntriesHasUpdate = true;
4846
}
4947

5048
public override void OnDisable()
@@ -108,7 +106,7 @@ private void RepositoryOnStatusEntriesChanged(CacheUpdateEvent cacheUpdateEvent)
108106
if (!lastStatusEntriesChangedEvent.Equals(cacheUpdateEvent))
109107
{
110108
lastStatusEntriesChangedEvent = cacheUpdateEvent;
111-
currentStatusHasUpdate = true;
109+
currentStatusEntriesHasUpdate = true;
112110
Redraw();
113111
}
114112
}
@@ -153,9 +151,9 @@ private void MaybeUpdateData()
153151
currentBranch = string.Format("[{0}]", Repository.CurrentBranchName);
154152
}
155153

156-
if (currentStatusHasUpdate)
154+
if (currentStatusEntriesHasUpdate)
157155
{
158-
currentStatusHasUpdate = false;
156+
currentStatusEntriesHasUpdate = false;
159157
var entries = Repository.CurrentChanges;
160158
tree.UpdateEntries(entries.Where(x => x.Status != GitFileStatus.Ignored).ToList());
161159
}

0 commit comments

Comments
 (0)