diff --git a/app/src/main/java/eu/steffo/twom/ui/scaffold/TwoMMatrixProvider.kt b/app/src/main/java/eu/steffo/twom/ui/scaffold/TwoMMatrixProvider.kt index a0ac117..b07e98b 100644 --- a/app/src/main/java/eu/steffo/twom/ui/scaffold/TwoMMatrixProvider.kt +++ b/app/src/main/java/eu/steffo/twom/ui/scaffold/TwoMMatrixProvider.kt @@ -9,8 +9,10 @@ import eu.steffo.twom.R import org.matrix.android.sdk.api.Matrix import org.matrix.android.sdk.api.MatrixConfiguration import org.matrix.android.sdk.api.provider.RoomDisplayNameFallbackProvider +import org.matrix.android.sdk.api.session.Session val LocalMatrix = compositionLocalOf { null } +val LocalSession = compositionLocalOf { null } @Composable fun TwoMMatrixProvider( @@ -24,7 +26,13 @@ fun TwoMMatrixProvider( ) ) - CompositionLocalProvider(LocalMatrix provides matrix) { + // TODO: The session should be opened somewhere, I think. + val session = matrix.authenticationService().getLastAuthenticatedSession() + + CompositionLocalProvider( + LocalMatrix provides matrix, + LocalSession provides session, + ) { content() } }