mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-11 10:13:12 +02:00
Caches user profile in Account.
This commit is contained in:
@@ -54,8 +54,14 @@ class Account(
|
|||||||
val liveLanguages: AccountLiveData = AccountLiveData(this)
|
val liveLanguages: AccountLiveData = AccountLiveData(this)
|
||||||
val saveable: AccountLiveData = AccountLiveData(this)
|
val saveable: AccountLiveData = AccountLiveData(this)
|
||||||
|
|
||||||
|
var userProfileCache: User? = null
|
||||||
|
|
||||||
fun userProfile(): User {
|
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> {
|
fun followingChannels(): List<Channel> {
|
||||||
|
Reference in New Issue
Block a user