mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Update API around brandColor.
This commit is contained in:
committed by
Benoit Marty
parent
b62382ffc7
commit
38908a42a2
+12
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user