Update API around brandColor.

This commit is contained in:
Benoit Marty 2025-10-20 14:42:53 +02:00 committed by Benoit Marty
parent b62382ffc7
commit 38908a42a2
12 changed files with 29 additions and 6 deletions

View file

@ -73,3 +73,15 @@ fun List<SessionData>.toUserList(): List<String> {
fun Flow<List<SessionData>>.toUserListFlow(): Flow<List<String>> {
return map { it.toUserList() }
}
/**
* @return a flow emitting the userId of the latest session if logged in, null otherwise.
*/
fun SessionStore.userIdFlow(): Flow<String?> {
return loggedInStateFlow().map {
when (it) {
is LoggedInState.LoggedIn -> it.sessionId
is LoggedInState.NotLoggedIn -> null
}
}
}