Fixing the delay in updating the Note tab on the Profile View
This commit is contained in:
@@ -18,7 +18,6 @@ object NostrUserProfileDataSource: NostrDataSource<Note>("UserProfileFeed") {
|
|||||||
|
|
||||||
fun loadUserProfile(userId: String) {
|
fun loadUserProfile(userId: String) {
|
||||||
user = LocalCache.getOrCreateUser(userId)
|
user = LocalCache.getOrCreateUser(userId)
|
||||||
resetFilters()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createUserInfoFilter(): TypedFilter {
|
fun createUserInfoFilter(): TypedFilter {
|
||||||
|
|||||||
@@ -79,16 +79,21 @@ fun ProfileScreen(userId: String?, accountViewModel: AccountViewModel, navContro
|
|||||||
|
|
||||||
if (userId == null) return
|
if (userId == null) return
|
||||||
|
|
||||||
|
NostrUserProfileDataSource.loadUserProfile(userId)
|
||||||
|
NostrUserProfileFollowersDataSource.loadUserProfile(userId)
|
||||||
|
NostrUserProfileFollowsDataSource.loadUserProfile(userId)
|
||||||
|
NostrUserProfileZapsDataSource.loadUserProfile(userId)
|
||||||
|
|
||||||
val lifeCycleOwner = LocalLifecycleOwner.current
|
val lifeCycleOwner = LocalLifecycleOwner.current
|
||||||
|
|
||||||
DisposableEffect(accountViewModel) {
|
DisposableEffect(accountViewModel) {
|
||||||
val observer = LifecycleEventObserver { source, event ->
|
val observer = LifecycleEventObserver { source, event ->
|
||||||
if (event == Lifecycle.Event.ON_RESUME) {
|
if (event == Lifecycle.Event.ON_RESUME) {
|
||||||
println("Profile Start")
|
println("Profile Start")
|
||||||
NostrUserProfileDataSource.loadUserProfile(userId)
|
NostrUserProfileDataSource.start()
|
||||||
NostrUserProfileFollowersDataSource.loadUserProfile(userId)
|
NostrUserProfileFollowersDataSource.start()
|
||||||
NostrUserProfileFollowsDataSource.loadUserProfile(userId)
|
NostrUserProfileFollowsDataSource.start()
|
||||||
NostrUserProfileZapsDataSource.loadUserProfile(userId)
|
NostrUserProfileZapsDataSource.start()
|
||||||
}
|
}
|
||||||
if (event == Lifecycle.Event.ON_PAUSE) {
|
if (event == Lifecycle.Event.ON_PAUSE) {
|
||||||
println("Profile Stop")
|
println("Profile Stop")
|
||||||
|
|||||||
Reference in New Issue
Block a user