Skip to content

Commit

Permalink
Make the OnWaaSWalletCreated event in WaaSLogin static so that it is …
Browse files Browse the repository at this point in the history
…easier to subscribe to.
  • Loading branch information
BellringerQuinn committed Dec 7, 2023
1 parent fccd4fd commit dda0ff5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions Assets/SequenceExamples/Scripts/UI/LoginPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ private void OnMFAEmailFailedToSendHandler(string email, string error)

public void SubscribeToWaaSWalletCreatedEvent(Action<WaaSWallet> OnWaaSWalletCreatedHandler)
{
if (LoginHandler is WaaSLogin login)
{
login.OnWaaSWalletCreated += OnWaaSWalletCreatedHandler;
}
WaaSLogin.OnWaaSWalletCreated += OnWaaSWalletCreatedHandler;
}
}
}
7 changes: 2 additions & 5 deletions Assets/SequenceExamples/Scripts/UI/LoginPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ public void SetupLoginHandler(ILogin loginHandler)

_mfaPage.SetupLogin(loginHandler);
loginHandler.OnLoginSuccess += OnLoginSuccessHandler;

if (loginHandler is WaaSLogin waaSLogin)
{
waaSLogin.OnWaaSWalletCreated += OnWaaSWalletCreatedHandler;
}

WaaSLogin.OnWaaSWalletCreated += OnWaaSWalletCreatedHandler;
}

public void OpenTransitionPanel()
Expand Down
2 changes: 1 addition & 1 deletion Assets/SequenceSDK/WaaS/WaaSLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public WaaSLogin(AWSConfig awsConfig, int waasProjectId, string waasVersion, IVa
public event ILogin.OnLoginFailedHandler OnLoginFailed;
public event ILogin.OnMFAEmailSentHandler OnMFAEmailSent;
public event ILogin.OnMFAEmailFailedToSendHandler OnMFAEmailFailedToSend;
public Action<WaaSWallet> OnWaaSWalletCreated;
public static Action<WaaSWallet> OnWaaSWalletCreated;

public async Task Login(string email)
{
Expand Down

0 comments on commit dda0ff5

Please sign in to comment.