From 83394132627ef4e15f68c9239b2ce526f543a030 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 13 Mar 2026 15:20:01 -0400 Subject: [PATCH] Fixes copilot recommendation --- .../java/com/vitorpamplona/amethyst/AppModules.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt index e9e7c6f6f..cf9256dc4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt @@ -129,13 +129,6 @@ 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) @@ -406,6 +399,11 @@ class AppModules( delay(3000) videoCache } + + applicationIOScope.launch { + // Eagerly initialize OtsSharedPreferences off the main thread + otsPrefs + } } fun terminate(appContext: Context) {