Delete pending session store and states after session is created.

This commit is contained in:
Onuray Sahin 2020-10-06 17:02:49 +03:00
parent 1f4a360a0c
commit 3877b2f58e
2 changed files with 11 additions and 4 deletions

View File

@ -17,6 +17,7 @@ Improvements 🙌:
Bugfix 🐛: Bugfix 🐛:
- Improve support for image/audio/video/file selection with intent changes (#1376) - Improve support for image/audio/video/file selection with intent changes (#1376)
- Fix Splash layout on small screens - Fix Splash layout on small screens
- Invalid popup when pressing back (#1635)
Translations 🗣: Translations 🗣:
- -

View File

@ -419,11 +419,16 @@ class LoginViewModel @AssistedInject constructor(
loginConfig = action.loginConfig loginConfig = action.loginConfig
// If there is a pending email validation continue on this step // If there is a pending email validation continue on this step
try {
if (registrationWizard?.isRegistrationStarted == true) {
currentThreePid?.let { currentThreePid?.let {
if (isRegistrationStarted) {
handle(LoginAction.PostViewEvent(LoginViewEvents.OnSendEmailSuccess(it))) handle(LoginAction.PostViewEvent(LoginViewEvents.OnSendEmailSuccess(it)))
} }
} }
} catch (e: Throwable) {
// NOOP. API is designed to use wizards in a login/registration flow,
// but we need to check the state anyway.
}
} }
private fun handleResetPassword(action: LoginAction.ResetPassword) { private fun handleResetPassword(action: LoginAction.ResetPassword) {
@ -679,6 +684,7 @@ class LoginViewModel @AssistedInject constructor(
private fun onSessionCreated(session: Session) { private fun onSessionCreated(session: Session) {
activeSessionHolder.setActiveSession(session) activeSessionHolder.setActiveSession(session)
authenticationService.reset()
session.configureAndStart(applicationContext) session.configureAndStart(applicationContext)
setState { setState {
copy( copy(