mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-29 11:11:44 +01:00
Fixing the delay in updating the Note tab on the Profile View
This commit is contained in:
parent
af96f142cd
commit
0277fa7364
@ -18,7 +18,6 @@ object NostrUserProfileDataSource: NostrDataSource<Note>("UserProfileFeed") {
|
||||
|
||||
fun loadUserProfile(userId: String) {
|
||||
user = LocalCache.getOrCreateUser(userId)
|
||||
resetFilters()
|
||||
}
|
||||
|
||||
fun createUserInfoFilter(): TypedFilter {
|
||||
|
@ -79,16 +79,21 @@ fun ProfileScreen(userId: String?, accountViewModel: AccountViewModel, navContro
|
||||
|
||||
if (userId == null) return
|
||||
|
||||
NostrUserProfileDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileFollowersDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileFollowsDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileZapsDataSource.loadUserProfile(userId)
|
||||
|
||||
val lifeCycleOwner = LocalLifecycleOwner.current
|
||||
|
||||
DisposableEffect(accountViewModel) {
|
||||
val observer = LifecycleEventObserver { source, event ->
|
||||
if (event == Lifecycle.Event.ON_RESUME) {
|
||||
println("Profile Start")
|
||||
NostrUserProfileDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileFollowersDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileFollowsDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileZapsDataSource.loadUserProfile(userId)
|
||||
NostrUserProfileDataSource.start()
|
||||
NostrUserProfileFollowersDataSource.start()
|
||||
NostrUserProfileFollowsDataSource.start()
|
||||
NostrUserProfileZapsDataSource.start()
|
||||
}
|
||||
if (event == Lifecycle.Event.ON_PAUSE) {
|
||||
println("Profile Stop")
|
||||
|
Loading…
x
Reference in New Issue
Block a user