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:
@@ -87,7 +87,9 @@ class DefaultBiometricAuthenticatorManager @Inject constructor(
|
||||
|
||||
@Composable
|
||||
override fun rememberUnlockBiometricAuthenticator(): BiometricAuthenticator {
|
||||
val isBiometricAllowed by lockScreenStore.isBiometricUnlockAllowed().collectAsState(initial = false)
|
||||
val isBiometricAllowed by remember {
|
||||
lockScreenStore.isBiometricUnlockAllowed()
|
||||
}.collectAsState(initial = false)
|
||||
val lifecycleState by LocalLifecycleOwner.current.lifecycle.currentStateFlow.collectAsState()
|
||||
val isAvailable by remember(lifecycleState) {
|
||||
derivedStateOf { isBiometricAllowed && hasAvailableAuthenticator }
|
||||
|
||||
@@ -38,7 +38,9 @@ class LockScreenSettingsPresenter @Inject constructor(
|
||||
value = !lockScreenConfig.isPinMandatory && hasPinCode
|
||||
}
|
||||
}
|
||||
val isBiometricEnabled by lockScreenStore.isBiometricUnlockAllowed().collectAsState(initial = false)
|
||||
val isBiometricEnabled by remember {
|
||||
lockScreenStore.isBiometricUnlockAllowed()
|
||||
}.collectAsState(initial = false)
|
||||
var showRemovePinConfirmation by remember {
|
||||
mutableStateOf(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user