This idea of caching the user was causing issues.

This commit is contained in:
Vitor Pamplona
2023-02-22 18:03:49 -05:00
parent 639e3a5087
commit 83f785c5c4
@@ -61,8 +61,6 @@ class Account(
var latestContactList: ContactListEvent? = null var latestContactList: ContactListEvent? = null
) { ) {
var transientHiddenUsers: Set<String> = setOf() var transientHiddenUsers: Set<String> = setOf()
@Transient
var userProfile: User? = null
// Observers line up here. // Observers line up here.
val live: AccountLiveData = AccountLiveData(this) val live: AccountLiveData = AccountLiveData(this)
@@ -70,12 +68,7 @@ class Account(
val saveable: AccountLiveData = AccountLiveData(this) val saveable: AccountLiveData = AccountLiveData(this)
fun userProfile(): User { fun userProfile(): User {
userProfile?.let { return it } return LocalCache.getOrCreateUser(loggedIn.pubKey.toHexKey())
val newUser = LocalCache.getOrCreateUser(loggedIn.pubKey.toHexKey())
userProfile = newUser
return newUser
} }
fun followingChannels(): List<Channel> { fun followingChannels(): List<Channel> {