Fixes the wrong import

This commit is contained in:
Vitor Pamplona
2025-08-28 15:54:14 -04:00
parent f7eb043aac
commit 8493c95e07
5 changed files with 8 additions and 5 deletions

View File

@@ -26,7 +26,6 @@ import com.vitorpamplona.amethyst.model.LocalCache
import com.vitorpamplona.amethyst.model.NoteState
import com.vitorpamplona.amethyst.model.nip51Lists.blockedRelays.BlockedRelayListState
import com.vitorpamplona.amethyst.model.nip51Lists.proxyRelays.ProxyRelayListState
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav.scope
import com.vitorpamplona.quartz.nip01Core.core.HexKey
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl
import com.vitorpamplona.quartz.nip65RelayList.AdvertisedRelayListEvent

View File

@@ -25,10 +25,12 @@ import androidx.datastore.preferences.core.stringPreferencesKey
import com.vitorpamplona.quartz.nip01Core.core.HexKey
import com.vitorpamplona.quartz.nip47WalletConnect.Nip47WalletConnect
import com.vitorpamplona.quartz.utils.LargeCache
import kotlinx.coroutines.CoroutineScope
import java.io.File
class AccountSecretsEncryptedStores(
val rootFilesDir: () -> File,
val scope: CoroutineScope,
) {
companion object Companion {
val encryption = KeyStoreEncryption()
@@ -47,6 +49,7 @@ class AccountSecretsEncryptedStores(
produceFile = { file(npub) },
),
encryption,
scope = scope,
)
}

View File

@@ -24,8 +24,7 @@ import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.emptyPreferences
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav.scope
import com.vitorpamplona.quartz.nip47WalletConnect.Nip47WalletConnect.Nip47URI.Companion.parser
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.map
import java.io.IOException
@@ -34,6 +33,7 @@ suspend fun <T> DataStore<Preferences>.getProperty(
key: Preferences.Key<String>,
parser: (String) -> T,
serializer: (T) -> String,
scope: CoroutineScope,
): UpdatablePropertyFlow<T> =
UpdatablePropertyFlow<T>(
flow =

View File

@@ -24,7 +24,7 @@ import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.emptyPreferences
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav.scope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.map
@@ -34,6 +34,7 @@ import java.util.Base64
class EncryptedDataStore(
private val store: DataStore<Preferences>,
private val encryption: KeyStoreEncryption = KeyStoreEncryption(),
private val scope: CoroutineScope,
) {
private fun decode(str: String): ByteArray = Base64.getDecoder().decode(str)

View File

@@ -47,7 +47,6 @@ import com.vitorpamplona.amethyst.service.notifications.PushNotificationUtils
import com.vitorpamplona.amethyst.service.relayClient.authCommand.compose.RelayAuthSubscription
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.account.AccountFilterAssemblerSubscription
import com.vitorpamplona.amethyst.ui.navigation.AppNavigation
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav.scope
import com.vitorpamplona.amethyst.ui.navigation.routes.Route
import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel
import com.vitorpamplona.amethyst.ui.screen.SharedPreferencesViewModel
@@ -166,6 +165,7 @@ fun NotificationRegistration(accountViewModel: AccountViewModel) {
}
}
} else {
val scope = rememberCoroutineScope()
// no need for push permissions before 33
LifecycleResumeEffect(key1 = accountViewModel) {
Log.d("RegisterAccounts", "Registering for push notifications")