From 13d05dc5999fbbf761a41351e90504b1ca05aa99 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 3 Oct 2025 15:59:43 -0400 Subject: [PATCH] Loads the main account in parallel faster before the screen needs it --- .../src/main/java/com/vitorpamplona/amethyst/AppModules.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt index 906c3b510c..f8b44419c3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt @@ -25,6 +25,7 @@ import android.content.Context import androidx.security.crypto.EncryptedSharedPreferences import coil3.disk.DiskCache import coil3.memory.MemoryCache +import com.vitorpamplona.amethyst.LocalPreferences import com.vitorpamplona.amethyst.model.LocalCache import com.vitorpamplona.amethyst.model.accountsCache.AccountCacheState import com.vitorpamplona.amethyst.model.nip03Timestamp.IncomingOtsEventVerifier @@ -251,6 +252,11 @@ class AppModules( fun initiate(appContext: Context) { Thread.setDefaultUncaughtExceptionHandler(UnexpectedCrashSaver(crashReportCache, applicationIOScope)) + applicationIOScope.launch { + // loads main account quickly. + LocalPreferences.loadAccountConfigFromEncryptedStorage() + } + // forces initialization of uiPrefs in the main thread to avoid blinking themes uiPrefs