From 9b1c47f4a587f1e66c5c6b38429163fda4893d5d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 22 Jun 2023 14:53:10 -0400 Subject: [PATCH] Checks main thread in preferences --- .../main/java/com/vitorpamplona/amethyst/LocalPreferences.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt b/app/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt index df3ec608d..57d193ef7 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt @@ -12,6 +12,7 @@ import com.vitorpamplona.amethyst.model.KIND3_FOLLOWS import com.vitorpamplona.amethyst.model.RelaySetupInfo import com.vitorpamplona.amethyst.model.hexToByteArray import com.vitorpamplona.amethyst.service.HttpClient +import com.vitorpamplona.amethyst.service.checkNotInMainThread import com.vitorpamplona.amethyst.service.model.ContactListEvent import com.vitorpamplona.amethyst.service.model.Event import com.vitorpamplona.amethyst.service.model.Event.Companion.getRefinedEvent @@ -199,6 +200,8 @@ object LocalPreferences { } fun saveToEncryptedStorage(account: Account) { + checkNotInMainThread() + val prefs = encryptedPreferences(account.userProfile().pubkeyNpub()) prefs.edit().apply { account.loggedIn.privKey?.let { putString(PrefKeys.NOSTR_PRIVKEY, it.toHex()) }