Feed invalidation is necessary for lists

pull/427/head
Vitor Pamplona 2023-05-25 20:40:04 -04:00
rodzic fe317964b8
commit 56a68b9100
3 zmienionych plików z 24 dodań i 20 usunięć

Wyświetl plik

@ -60,6 +60,8 @@ fun HomeScreen(
HomeNewThreadFeedFilter.account = account
HomeConversationsFeedFilter.account = account
NostrHomeDataSource.invalidateFilters()
homeFeedViewModel.invalidateData(true)
repliesFeedViewModel.invalidateData(true)
}
if (wantsToAddNip47 != null) {

Wyświetl plik

@ -69,19 +69,10 @@ fun NotificationScreen(
val accountState by accountViewModel.accountLiveData.observeAsState()
val account = remember(accountState) { accountState?.account } ?: return
if (scrollToTop) {
val scope = rememberCoroutineScope()
LaunchedEffect(key1 = Unit) {
scope.launch(Dispatchers.IO) {
notifFeedViewModel.clear()
notifFeedViewModel.invalidateData(true)
}
}
}
LaunchedEffect(accountViewModel, account.defaultNotificationFollowList) {
NostrAccountDataSource.invalidateFilters()
NotificationFeedFilter.account = account
notifFeedViewModel.invalidateData(true)
}
val lifeCycleOwner = LocalLifecycleOwner.current
@ -99,6 +90,16 @@ fun NotificationScreen(
}
}
if (scrollToTop) {
val scope = rememberCoroutineScope()
LaunchedEffect(key1 = Unit) {
scope.launch(Dispatchers.IO) {
notifFeedViewModel.clear()
notifFeedViewModel.invalidateData(true)
}
}
}
Column(Modifier.fillMaxHeight()) {
Column(
modifier = Modifier.padding(vertical = 0.dp)

Wyświetl plik

@ -110,20 +110,11 @@ fun VideoScreen(
NostrVideoDataSource.account = account
VideoFeedFilter.account = account
if (scrollToTop) {
val scope = rememberCoroutineScope()
LaunchedEffect(key1 = Unit) {
scope.launch(Dispatchers.IO) {
NostrVideoDataSource.resetFilters()
videoFeedView.invalidateData()
}
}
}
LaunchedEffect(accountViewModel, accountState.value?.account?.defaultStoriesFollowList) {
VideoFeedFilter.account = account
NostrVideoDataSource.account = account
NostrVideoDataSource.resetFilters()
videoFeedView.invalidateData()
}
DisposableEffect(accountViewModel) {
@ -146,6 +137,16 @@ fun VideoScreen(
}
}
if (scrollToTop) {
val scope = rememberCoroutineScope()
LaunchedEffect(key1 = Unit) {
scope.launch(Dispatchers.IO) {
NostrVideoDataSource.resetFilters()
videoFeedView.invalidateData()
}
}
}
Column(Modifier.fillMaxHeight()) {
Column(
modifier = Modifier.padding(vertical = 0.dp)