mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-25 21:56:53 +02:00
Small correction in the method name
This commit is contained in:
@@ -498,7 +498,7 @@ object LocalPreferences {
|
||||
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(
|
||||
sharedSettings: Settings,
|
||||
@@ -529,7 +529,7 @@ object LocalPreferences {
|
||||
|
||||
val mutex = Mutex()
|
||||
|
||||
suspend fun loadCurrentAccountFromEncryptedStorage(npub: String): AccountSettings? {
|
||||
suspend fun loadAccountConfigFromEncryptedStorage(npub: String): AccountSettings? {
|
||||
// if already loaded, return right away
|
||||
if (cachedAccounts.containsKey(npub)) {
|
||||
return cachedAccounts[npub]
|
||||
|
@@ -66,7 +66,7 @@ class EventNotificationConsumer(
|
||||
var matchAccount = false
|
||||
LocalPreferences.allSavedAccounts().forEach {
|
||||
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}")
|
||||
try {
|
||||
consumeIfMatchesAccount(event, acc)
|
||||
@@ -124,7 +124,7 @@ class EventNotificationConsumer(
|
||||
var matchAccount = false
|
||||
LocalPreferences.allSavedAccounts().forEach {
|
||||
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}")
|
||||
try {
|
||||
val account = Amethyst.instance.loadAccount(accountSettings)
|
||||
|
@@ -80,7 +80,7 @@ class RegisterAccounts(
|
||||
if (account.hasPrivKey || account.loggedInWithExternalSigner) {
|
||||
Log.d(tag, "Register Account ${account.npub}")
|
||||
|
||||
val acc = LocalPreferences.loadCurrentAccountFromEncryptedStorage(account.npub)
|
||||
val acc = LocalPreferences.loadAccountConfigFromEncryptedStorage(account.npub)
|
||||
if (acc != null && acc.isWriteable()) {
|
||||
val nip65Read = acc.backupNIP65RelayList?.readRelaysNorm() ?: emptyList()
|
||||
val nip17Read = acc.backupDMRelayList?.relays() ?: emptyList()
|
||||
|
@@ -98,7 +98,7 @@ class AccountStateViewModel : ViewModel() {
|
||||
private suspend fun loginWithDefaultAccount(route: Route? = null) {
|
||||
val accountSettings =
|
||||
withContext(Dispatchers.IO) {
|
||||
LocalPreferences.loadCurrentAccountFromEncryptedStorage()
|
||||
LocalPreferences.loadAccountConfigFromEncryptedStorage()
|
||||
}
|
||||
|
||||
if (accountSettings != null) {
|
||||
|
Reference in New Issue
Block a user