diff --git a/app/src/main/java/chat/revolt/screens/settings/ExperimentsSettingsScreen.kt b/app/src/main/java/chat/revolt/screens/settings/ExperimentsSettingsScreen.kt index 2d3cd571..29a79173 100644 --- a/app/src/main/java/chat/revolt/screens/settings/ExperimentsSettingsScreen.kt +++ b/app/src/main/java/chat/revolt/screens/settings/ExperimentsSettingsScreen.kt @@ -7,6 +7,7 @@ import androidx.compose.material3.ListItem import androidx.compose.material3.Switch import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextOverflow @@ -26,6 +27,12 @@ import kotlinx.coroutines.launch class ExperimentsSettingsScreenViewModel : ViewModel() { private val kv = KVStorage(RevoltApplication.instance) + fun init() { + viewModelScope.launch { + useKotlinMdRendererChecked.value = Experiments.useKotlinBasedMarkdownRenderer.isEnabled + } + } + fun disableExperiments(then: () -> Unit = {}) { viewModelScope.launch { kv.remove("experimentsEnabled") @@ -50,6 +57,10 @@ fun ExperimentsSettingsScreen( navController: NavController, viewModel: ExperimentsSettingsScreenViewModel = viewModel() ) { + LaunchedEffect(Unit) { + viewModel.init() + } + SettingsPage( navController, title = {