Update API around brandColor.
This commit is contained in:
parent
b62382ffc7
commit
38908a42a2
12 changed files with 29 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue