mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
fix(privacy): use LaunchedEffect instead of remember for VM reset
The remember(...) call returned Unit, which tripped the RememberReturnType lint. Use LaunchedEffect, which is the idiomatic Compose API for keyed side effects.
This commit is contained in:
+2
-3
@@ -30,7 +30,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
@@ -78,11 +78,10 @@ fun PrivacyOptionsScreen(
|
||||
|
||||
// Reset all three view models from disk-loaded state exactly once,
|
||||
// mirroring how the old screen reset only the Tor VM.
|
||||
remember(torVm, i2pVm, pickerVm) {
|
||||
LaunchedEffect(torVm, i2pVm, pickerVm) {
|
||||
torVm.reset(torSettingsFlow.toSettings())
|
||||
i2pVm.reset(i2pSettingsFlow.toSettings())
|
||||
pickerVm.reset(preferredTransport)
|
||||
Unit
|
||||
}
|
||||
|
||||
PrivacyOptionsScreenContents(
|
||||
|
||||
Reference in New Issue
Block a user