mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Remember flows (#4533)
* Add Konsist test to ensure that the result of a function returning a flow is remembered. * Remember flows before they are collected by state. * Fix compilation issue * Make isOnline a val. * Make selectedUsers() a val. * Make flow() a val. * Make getUserConsent(), didAskUserConsent() and getAnalyticsId() some val. * Remove Timeline.paginationStatus() and replace by direct access to the underlined flow. * Simplify test * userConsentFlow must be initialized before because it's used in observeUserConsent * Fix test compilation
This commit is contained in:
+3
-3
@@ -24,11 +24,11 @@ import javax.inject.Inject
|
||||
@ContributesBinding(AppScope::class)
|
||||
class NoopAnalyticsService @Inject constructor() : AnalyticsService {
|
||||
override fun getAvailableAnalyticsProviders(): Set<AnalyticsProvider> = emptySet()
|
||||
override fun getUserConsent(): Flow<Boolean> = flowOf(false)
|
||||
override val userConsentFlow: Flow<Boolean> = flowOf(false)
|
||||
override suspend fun setUserConsent(userConsent: Boolean) = Unit
|
||||
override fun didAskUserConsent(): Flow<Boolean> = flowOf(true)
|
||||
override val didAskUserConsentFlow: Flow<Boolean> = flowOf(true)
|
||||
override suspend fun setDidAskUserConsent() = Unit
|
||||
override fun getAnalyticsId(): Flow<String> = flowOf("")
|
||||
override val analyticsIdFlow: Flow<String> = flowOf("")
|
||||
override suspend fun setAnalyticsId(analyticsId: String) = Unit
|
||||
override suspend fun reset() = Unit
|
||||
override fun capture(event: VectorAnalyticsEvent) = Unit
|
||||
|
||||
Reference in New Issue
Block a user