diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt index 25db5b3f4c..46e068a16c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt @@ -117,6 +117,12 @@ class AppModules( OtsSharedPreferences(appContext, applicationIOScope) } + init { + applicationIOScope.launch { + // Eagerly initialize OtsSharedPreferences off the main thread + otsPrefs + } + } // App services that should be run as soon as there are subscribers to their flows val locationManager = LocationState(appContext, applicationIOScope) val connManager = ConnectivityManager(appContext, applicationIOScope) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/OtsSettingsSection.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/OtsSettingsSection.kt index 5f2e861aba..380c774427 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/OtsSettingsSection.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/OtsSettingsSection.kt @@ -234,7 +234,7 @@ private fun CustomExplorerInput( onSave: (String?) -> Unit, ) { var input by rememberSaveable(currentUrl) { mutableStateOf(currentUrl ?: "") } - var validationError by remember { mutableStateOf(null) } + var validationError by remember(currentUrl) { mutableStateOf(null) } val kb = LocalSoftwareKeyboardController.current fun trySave() {