Share the environment flow and provide better default (#4355)

This commit is contained in:
David Perez
2024-11-21 14:15:44 -06:00
committed by GitHub
parent 8a534d11d2
commit c4f13fc8bd

View File

@@ -33,15 +33,14 @@ class EnvironmentRepositoryImpl(
environmentDiskSource.preAuthEnvironmentUrlData = value.environmentUrlData
}
override val environmentStateFlow: StateFlow<Environment>
get() = environmentDiskSource
.preAuthEnvironmentUrlDataFlow
.map { it.toEnvironmentUrlsOrDefault() }
.stateIn(
scope = scope,
started = SharingStarted.Lazily,
initialValue = Environment.Us,
)
override val environmentStateFlow: StateFlow<Environment> = environmentDiskSource
.preAuthEnvironmentUrlDataFlow
.map { it.toEnvironmentUrlsOrDefault() }
.stateIn(
scope = scope,
started = SharingStarted.Lazily,
initialValue = environment,
)
init {
authDiskSource