3
3
using Newtonsoft . Json ;
4
4
using Sequence . Boilerplates . Login ;
5
5
using Sequence . Boilerplates . PlayerProfile ;
6
- using Sequence . Config ;
7
6
using Sequence . Contracts ;
8
7
using Sequence . EmbeddedWallet ;
9
8
using Sequence . Marketplace ;
10
9
using Sequence . Pay ;
11
- using Sequence . Utils . SecureStorage ;
12
10
using UnityEngine ;
13
11
14
12
namespace Sequence . Boilerplates
@@ -98,22 +96,14 @@ private void HideFeatureSelection()
98
96
_featureSelection . SetActive ( false ) ;
99
97
}
100
98
101
- private void TryRecoverSessionToOpenLoginWindow ( )
99
+ private async void TryRecoverSessionToOpenLoginWindow ( )
102
100
{
103
101
HideFeatureSelection ( ) ;
104
- var config = SequenceConfig . GetConfig ( ) ;
105
- var storeSessionInfoAndSkipLoginWhenPossible = config . StoreSessionKey ( ) ;
106
- var loginHandler = SequenceLogin . GetInstance ( ) ;
107
102
108
- if ( SecureStorageFactory . IsSupportedPlatform ( ) && storeSessionInfoAndSkipLoginWhenPossible )
109
- {
110
- loginHandler . TryToRestoreSession ( ) ;
111
- loginHandler . SetupAuthenticator ( ) ;
112
- }
113
- else
114
- {
115
- OnFailedToRecoverSession ( "Secure Storage disabled" ) ;
116
- }
103
+ var loginHandler = SequenceLogin . GetInstance ( ) ;
104
+ var ( storageEnabled , wallet ) = await loginHandler . TryToRestoreSessionAsync ( ) ;
105
+ if ( ! storageEnabled )
106
+ OnFailedToRecoverSession ( "Secure storage is disabled" ) ;
117
107
}
118
108
119
109
private void OnFailedToRecoverSession ( string error )
@@ -307,4 +297,4 @@ private async void DoShowCheckoutPanel()
307
297
new SequenceCheckout ( _wallet , Chain . Polygon , saleContract , collection , "1" , 1 ) , ShowDefaultWindow ) ;
308
298
}
309
299
}
310
- }
300
+ }
0 commit comments