Small correction in the method name

This commit is contained in:
Vitor Pamplona
2025-09-07 12:23:34 -04:00
parent 93e2f66559
commit 0621cfb46c
4 changed files with 6 additions and 6 deletions

View File

@@ -498,7 +498,7 @@ object LocalPreferences {
Log.d("LocalPreferences", "Saved to encrypted storage") Log.d("LocalPreferences", "Saved to encrypted storage")
} }
suspend fun loadCurrentAccountFromEncryptedStorage(): AccountSettings? = currentAccount()?.let { loadCurrentAccountFromEncryptedStorage(it) } suspend fun loadAccountConfigFromEncryptedStorage(): AccountSettings? = currentAccount()?.let { loadAccountConfigFromEncryptedStorage(it) }
suspend fun saveSharedSettings( suspend fun saveSharedSettings(
sharedSettings: Settings, sharedSettings: Settings,
@@ -529,7 +529,7 @@ object LocalPreferences {
val mutex = Mutex() val mutex = Mutex()
suspend fun loadCurrentAccountFromEncryptedStorage(npub: String): AccountSettings? { suspend fun loadAccountConfigFromEncryptedStorage(npub: String): AccountSettings? {
// if already loaded, return right away // if already loaded, return right away
if (cachedAccounts.containsKey(npub)) { if (cachedAccounts.containsKey(npub)) {
return cachedAccounts[npub] return cachedAccounts[npub]

View File

@@ -66,7 +66,7 @@ class EventNotificationConsumer(
var matchAccount = false var matchAccount = false
LocalPreferences.allSavedAccounts().forEach { LocalPreferences.allSavedAccounts().forEach {
if (!matchAccount && (it.hasPrivKey || it.loggedInWithExternalSigner)) { if (!matchAccount && (it.hasPrivKey || it.loggedInWithExternalSigner)) {
LocalPreferences.loadCurrentAccountFromEncryptedStorage(it.npub)?.let { acc -> LocalPreferences.loadAccountConfigFromEncryptedStorage(it.npub)?.let { acc ->
Log.d(TAG, "New Notification Testing if for ${it.npub}") Log.d(TAG, "New Notification Testing if for ${it.npub}")
try { try {
consumeIfMatchesAccount(event, acc) consumeIfMatchesAccount(event, acc)
@@ -124,7 +124,7 @@ class EventNotificationConsumer(
var matchAccount = false var matchAccount = false
LocalPreferences.allSavedAccounts().forEach { LocalPreferences.allSavedAccounts().forEach {
if (!matchAccount && (it.hasPrivKey || it.loggedInWithExternalSigner) && it.npub in npubs) { if (!matchAccount && (it.hasPrivKey || it.loggedInWithExternalSigner) && it.npub in npubs) {
LocalPreferences.loadCurrentAccountFromEncryptedStorage(it.npub)?.let { accountSettings -> LocalPreferences.loadAccountConfigFromEncryptedStorage(it.npub)?.let { accountSettings ->
Log.d(TAG, "New Notification Testing if for ${it.npub}") Log.d(TAG, "New Notification Testing if for ${it.npub}")
try { try {
val account = Amethyst.instance.loadAccount(accountSettings) val account = Amethyst.instance.loadAccount(accountSettings)

View File

@@ -80,7 +80,7 @@ class RegisterAccounts(
if (account.hasPrivKey || account.loggedInWithExternalSigner) { if (account.hasPrivKey || account.loggedInWithExternalSigner) {
Log.d(tag, "Register Account ${account.npub}") Log.d(tag, "Register Account ${account.npub}")
val acc = LocalPreferences.loadCurrentAccountFromEncryptedStorage(account.npub) val acc = LocalPreferences.loadAccountConfigFromEncryptedStorage(account.npub)
if (acc != null && acc.isWriteable()) { if (acc != null && acc.isWriteable()) {
val nip65Read = acc.backupNIP65RelayList?.readRelaysNorm() ?: emptyList() val nip65Read = acc.backupNIP65RelayList?.readRelaysNorm() ?: emptyList()
val nip17Read = acc.backupDMRelayList?.relays() ?: emptyList() val nip17Read = acc.backupDMRelayList?.relays() ?: emptyList()

View File

@@ -98,7 +98,7 @@ class AccountStateViewModel : ViewModel() {
private suspend fun loginWithDefaultAccount(route: Route? = null) { private suspend fun loginWithDefaultAccount(route: Route? = null) {
val accountSettings = val accountSettings =
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
LocalPreferences.loadCurrentAccountFromEncryptedStorage() LocalPreferences.loadAccountConfigFromEncryptedStorage()
} }
if (accountSettings != null) { if (accountSettings != null) {