mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 22:43:44 +02:00
Caches user profile in Account.
This commit is contained in:
@@ -54,8 +54,14 @@ class Account(
|
||||
val liveLanguages: AccountLiveData = AccountLiveData(this)
|
||||
val saveable: AccountLiveData = AccountLiveData(this)
|
||||
|
||||
var userProfileCache: User? = null
|
||||
|
||||
fun userProfile(): User {
|
||||
return LocalCache.getOrCreateUser(loggedIn.pubKey.toHexKey())
|
||||
return userProfileCache ?: run {
|
||||
val myUser: User = LocalCache.getOrCreateUser(loggedIn.pubKey.toHexKey())
|
||||
userProfileCache = myUser
|
||||
myUser
|
||||
}
|
||||
}
|
||||
|
||||
fun followingChannels(): List<Channel> {
|
||||
|
Reference in New Issue
Block a user