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

Commit ad23dcd

Browse files
committed
We shouldn't update data here and we should redraw on the main thread
1 parent fa2f48e commit ad23dcd

File tree

1 file changed

+5
-2
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/UI

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ private void ValidateCachedData(IRepository repository)
212212
private void MaybeUpdateData()
213213
{
214214
connection = Platform.Keychain.Connections.FirstOrDefault();
215+
215216
if (repositoryProgressHasUpdate)
216217
{
217218
if (repositoryProgress != null)
@@ -425,8 +426,10 @@ private void ApplicationManagerOnProgress(IProgress progress)
425426

426427
private void ConnectionsChanged()
427428
{
428-
connection = Platform.Keychain.Connections.FirstOrDefault();
429-
Redraw();
429+
if (!ThreadingHelper.InUIThread)
430+
TaskManager.RunInUI(Redraw);
431+
else
432+
Redraw();
430433
}
431434

432435
public override void OnUI()

0 commit comments

Comments
 (0)