1
Fork 0
mirror of https://github.com/Steffo99/twom.git synced 2024-11-25 17:44:24 +00:00

Load saved session if available

This commit is contained in:
Steffo 2023-11-24 19:20:11 +01:00
parent 8c255b55fd
commit 17dec236c2
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -42,16 +42,18 @@ class MatrixActivity : ComponentActivity() {
} }
} }
} }
}
override fun onStart() { // Check if there's a session already stored
super.onStart() session = TwoMMatrix.matrix.authenticationService().getLastAuthenticatedSession()
setContent { setContent {
MatrixActivityScaffold( MatrixActivityScaffold(
onClickLogin = this::onClickLogin onClickLogin = this::onClickLogin,
session = session,
) )
} }
// No onStart is needed, as session already sets content when it's changed
} }
private fun onClickLogin() { private fun onClickLogin() {