diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt index 492ae688e..4b7a5018a 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/util/Preference.kt @@ -4,12 +4,10 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.State import androidx.compose.runtime.collectAsState import androidx.compose.runtime.remember -import androidx.compose.runtime.rememberCoroutineScope -import kotlinx.coroutines.CoroutineScope import tachiyomi.core.common.preference.Preference @Composable -fun Preference.collectAsState(scope: CoroutineScope = rememberCoroutineScope()): State { - val flow = remember(this) { stateIn(scope) } - return flow.collectAsState() +fun Preference.collectAsState(): State { + val flow = remember(this) { changes() } + return flow.collectAsState(initial = get()) }