Skip to content

Commit 0fe1d13

Browse files
fixed stuck in loading screen when a user entered an empty email (#208)
* fixed stuck in loading screen when a user entered an empty email * increment package version * increment package version * fixed MFA stuck in loading screen * version bump --------- Co-authored-by: Quinn Purdy <[email protected]> Co-authored-by: Quinn Purdy <[email protected]>
1 parent 084c2f9 commit 0fe1d13

File tree

5 files changed

+157
-114
lines changed

5 files changed

+157
-114
lines changed

Packages/Sequence-Unity/Sequence/SequenceFrontend/Prefabs/LoginPanel.prefab

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ RectTransform:
169169
- {fileID: 3911810628226866637}
170170
- {fileID: 3911810628424708713}
171171
- {fileID: 3911810627461880608}
172+
- {fileID: 7757550704155501701}
172173
m_Father: {fileID: 0}
173174
m_RootOrder: 0
174175
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -5793,7 +5794,7 @@ MonoBehaviour:
57935794
_animation: 0
57945795
_errorText: {fileID: 3911810627816165819}
57955796
_infoPopupPanelPrefab: {fileID: 8067163605015323916, guid: a5a68ec1b8c3c430694abc1729fc5369, type: 3}
5796-
_loadingScreenPrefab: {fileID: 3094631411173026328, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
5797+
_loadingScreen: {fileID: 181291193031515344}
57975798
--- !u!114 &702636062
57985799
MonoBehaviour:
57995800
m_ObjectHideFlags: 0
@@ -6453,7 +6454,7 @@ MonoBehaviour:
64536454
- {fileID: 3911810626580786188}
64546455
_enterCodeText: {fileID: 3911810626720903612}
64556456
_errorText: {fileID: 3911810627950373898}
6456-
_loadingScreenPrefab: {fileID: 3094631411173026328, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
6457+
_loadingScreen: {fileID: 181291193031515344}
64576458
--- !u!1 &3911810628491489749
64586459
GameObject:
64596460
m_ObjectHideFlags: 0
@@ -7105,3 +7106,110 @@ MonoBehaviour:
71057106
m_hasFontAssetChanged: 0
71067107
m_baseMaterial: {fileID: 0}
71077108
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
7109+
--- !u!1001 &2915594493199070920
7110+
PrefabInstance:
7111+
m_ObjectHideFlags: 0
7112+
serializedVersion: 2
7113+
m_Modification:
7114+
m_TransformParent: {fileID: 3911810626490335503}
7115+
m_Modifications:
7116+
- target: {fileID: 3094631411173026328, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7117+
propertyPath: m_Name
7118+
value: LoadingScreen
7119+
objectReference: {fileID: 0}
7120+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7121+
propertyPath: m_Pivot.x
7122+
value: 0.5
7123+
objectReference: {fileID: 0}
7124+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7125+
propertyPath: m_Pivot.y
7126+
value: 0.5
7127+
objectReference: {fileID: 0}
7128+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7129+
propertyPath: m_RootOrder
7130+
value: 3
7131+
objectReference: {fileID: 0}
7132+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7133+
propertyPath: m_AnchorMax.x
7134+
value: 1
7135+
objectReference: {fileID: 0}
7136+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7137+
propertyPath: m_AnchorMax.y
7138+
value: 1
7139+
objectReference: {fileID: 0}
7140+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7141+
propertyPath: m_AnchorMin.x
7142+
value: 0
7143+
objectReference: {fileID: 0}
7144+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7145+
propertyPath: m_AnchorMin.y
7146+
value: 0
7147+
objectReference: {fileID: 0}
7148+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7149+
propertyPath: m_SizeDelta.x
7150+
value: 0
7151+
objectReference: {fileID: 0}
7152+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7153+
propertyPath: m_SizeDelta.y
7154+
value: 0
7155+
objectReference: {fileID: 0}
7156+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7157+
propertyPath: m_LocalPosition.x
7158+
value: 0
7159+
objectReference: {fileID: 0}
7160+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7161+
propertyPath: m_LocalPosition.y
7162+
value: 0
7163+
objectReference: {fileID: 0}
7164+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7165+
propertyPath: m_LocalPosition.z
7166+
value: 0
7167+
objectReference: {fileID: 0}
7168+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7169+
propertyPath: m_LocalRotation.w
7170+
value: 1
7171+
objectReference: {fileID: 0}
7172+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7173+
propertyPath: m_LocalRotation.x
7174+
value: 0
7175+
objectReference: {fileID: 0}
7176+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7177+
propertyPath: m_LocalRotation.y
7178+
value: 0
7179+
objectReference: {fileID: 0}
7180+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7181+
propertyPath: m_LocalRotation.z
7182+
value: 0
7183+
objectReference: {fileID: 0}
7184+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7185+
propertyPath: m_AnchoredPosition.x
7186+
value: 0
7187+
objectReference: {fileID: 0}
7188+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7189+
propertyPath: m_AnchoredPosition.y
7190+
value: 0
7191+
objectReference: {fileID: 0}
7192+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7193+
propertyPath: m_LocalEulerAnglesHint.x
7194+
value: 0
7195+
objectReference: {fileID: 0}
7196+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7197+
propertyPath: m_LocalEulerAnglesHint.y
7198+
value: 0
7199+
objectReference: {fileID: 0}
7200+
- target: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7201+
propertyPath: m_LocalEulerAnglesHint.z
7202+
value: 0
7203+
objectReference: {fileID: 0}
7204+
m_RemovedComponents: []
7205+
m_SourcePrefab: {fileID: 100100000, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7206+
--- !u!1 &181291193031515344 stripped
7207+
GameObject:
7208+
m_CorrespondingSourceObject: {fileID: 3094631411173026328, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7209+
m_PrefabInstance: {fileID: 2915594493199070920}
7210+
m_PrefabAsset: {fileID: 0}
7211+
--- !u!224 &7757550704155501701 stripped
7212+
RectTransform:
7213+
m_CorrespondingSourceObject: {fileID: 4890380321044959821, guid: 21aa1af318f304faca1367525db9bc28, type: 3}
7214+
m_PrefabInstance: {fileID: 2915594493199070920}
7215+
m_PrefabAsset: {fileID: 0}
Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
using System;
21
using System.Collections;
32
using System.Collections.Generic;
4-
using Sequence.Authentication;
5-
using Sequence.EmbeddedWallet;
63
using UnityEngine;
74
using UnityEngine.UI;
8-
using Random = System.Random;
95

106
namespace Sequence.Demo
117
{
@@ -15,74 +11,14 @@ public class LoadingScreen : MonoBehaviour
1511
[SerializeField] [Range(0, 255)] private int _maxAlpha = 255;
1612
[SerializeField] [Range(0, 255)] private int _minAlpha = 0;
1713
[SerializeField] private float _animationSpeed = .1f;
18-
private LoginPanel _loginPanel;
1914

2015
private const int DefaultFullAlphaValue = 255;
2116

2217
private void OnEnable()
2318
{
24-
_loginPanel = FindObjectOfType<LoginPanel>();
25-
if (_loginPanel != null)
26-
{
27-
_loginPanel.LoginHandler.OnLoginSuccess += OnLoginSuccessHandler;
28-
_loginPanel.LoginHandler.OnMFAEmailSent += OnMFAEmailSentHandler;
29-
_loginPanel.LoginHandler.OnLoginFailed += OnLoginFailedHandler;
30-
_loginPanel.LoginHandler.OnMFAEmailFailedToSend += OnMFAEmailFailedToSendHandler;
31-
SequenceWallet.OnAccountFederationFailed += OnAccountFederationFailedHandler;
32-
SequenceWallet.OnAccountFederated += OnAccountFederatedHandler;
33-
}
34-
else
35-
{
36-
Debug.LogError("No LoginPanel found!");
37-
Destroy(gameObject);
38-
}
39-
4019
StartCoroutine(LoadingAnimation());
4120
}
4221

43-
private void OnDestroy()
44-
{
45-
if (_loginPanel != null)
46-
{
47-
_loginPanel.LoginHandler.OnLoginSuccess -= OnLoginSuccessHandler;
48-
_loginPanel.LoginHandler.OnMFAEmailSent -= OnMFAEmailSentHandler;
49-
_loginPanel.LoginHandler.OnLoginFailed -= OnLoginFailedHandler;
50-
_loginPanel.LoginHandler.OnMFAEmailFailedToSend -= OnMFAEmailFailedToSendHandler;
51-
SequenceWallet.OnAccountFederationFailed -= OnAccountFederationFailedHandler;
52-
SequenceWallet.OnAccountFederated -= OnAccountFederatedHandler;
53-
}
54-
}
55-
56-
private void OnLoginSuccessHandler(string sessionId, string walletAddress)
57-
{
58-
Destroy(gameObject);
59-
}
60-
61-
private void OnMFAEmailSentHandler(string email)
62-
{
63-
Destroy(gameObject);
64-
}
65-
66-
private void OnLoginFailedHandler(string error, LoginMethod method, string email, List<LoginMethod> loginMethods)
67-
{
68-
Destroy(gameObject);
69-
}
70-
71-
private void OnMFAEmailFailedToSendHandler(string email, string error)
72-
{
73-
Destroy(gameObject);
74-
}
75-
76-
private void OnAccountFederationFailedHandler(string error)
77-
{
78-
Destroy(gameObject);
79-
}
80-
81-
private void OnAccountFederatedHandler(Account account)
82-
{
83-
Destroy(gameObject);
84-
}
85-
8622
private IEnumerator LoadingAnimation()
8723
{
8824
int numberOfCircles = _circles.Length;
@@ -153,24 +89,5 @@ private int[] ShiftIndices(int[] indicesArray)
15389

15490
return shifted;
15591
}
156-
157-
private void OnApplicationFocus(bool hasFocus)
158-
{
159-
#if !UNITY_IOS
160-
if (hasFocus)
161-
{
162-
StartCoroutine(DestroyIfNotLoggingIn());
163-
}
164-
#endif
165-
}
166-
167-
private IEnumerator DestroyIfNotLoggingIn()
168-
{
169-
yield return new WaitForSecondsRealtime(0.1f);
170-
if (!_loginPanel.LoginHandler.IsLoggingIn())
171-
{
172-
Destroy(gameObject);
173-
}
174-
}
17592
}
17693
}

0 commit comments

Comments
 (0)