Skip to content

Commit 06e345e

Browse files
committed
disable loading screen when coming back from external login
1 parent 585e4e4 commit 06e345e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Packages/Sequence-Unity/Sequence/SequenceBoilerplates/Scripts/Login/SequenceLoginWindow.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections;
12
using System.Collections.Generic;
23
using Sequence.Authentication;
34
using Sequence.EmbeddedWallet;
@@ -154,5 +155,22 @@ private void LoginHandlerOnOnLoginFailed(string error, LoginMethod method, strin
154155
if (method == LoginMethod.Email)
155156
_emailCodeErrorText.text = "Invalid code.";
156157
}
158+
159+
private void OnApplicationFocus(bool hasFocus)
160+
{
161+
#if !UNITY_IOS
162+
if (hasFocus)
163+
{
164+
StartCoroutine(DisableLoadingScreenIfNotLoggingIn());
165+
}
166+
#endif
167+
}
168+
169+
private IEnumerator DisableLoadingScreenIfNotLoggingIn()
170+
{
171+
yield return new WaitForSecondsRealtime(0.1f);
172+
if (!_loginHandler.IsLoggingIn())
173+
SetLoading(false);
174+
}
157175
}
158176
}

0 commit comments

Comments
 (0)