Feed invalidation is necessary for lists
This commit is contained in:
@@ -60,6 +60,8 @@ fun HomeScreen(
|
|||||||
HomeNewThreadFeedFilter.account = account
|
HomeNewThreadFeedFilter.account = account
|
||||||
HomeConversationsFeedFilter.account = account
|
HomeConversationsFeedFilter.account = account
|
||||||
NostrHomeDataSource.invalidateFilters()
|
NostrHomeDataSource.invalidateFilters()
|
||||||
|
homeFeedViewModel.invalidateData(true)
|
||||||
|
repliesFeedViewModel.invalidateData(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wantsToAddNip47 != null) {
|
if (wantsToAddNip47 != null) {
|
||||||
|
|||||||
+11
-10
@@ -69,19 +69,10 @@ fun NotificationScreen(
|
|||||||
val accountState by accountViewModel.accountLiveData.observeAsState()
|
val accountState by accountViewModel.accountLiveData.observeAsState()
|
||||||
val account = remember(accountState) { accountState?.account } ?: return
|
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) {
|
LaunchedEffect(accountViewModel, account.defaultNotificationFollowList) {
|
||||||
NostrAccountDataSource.invalidateFilters()
|
NostrAccountDataSource.invalidateFilters()
|
||||||
NotificationFeedFilter.account = account
|
NotificationFeedFilter.account = account
|
||||||
|
notifFeedViewModel.invalidateData(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
val lifeCycleOwner = LocalLifecycleOwner.current
|
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.fillMaxHeight()) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = 0.dp)
|
modifier = Modifier.padding(vertical = 0.dp)
|
||||||
|
|||||||
@@ -110,20 +110,11 @@ fun VideoScreen(
|
|||||||
NostrVideoDataSource.account = account
|
NostrVideoDataSource.account = account
|
||||||
VideoFeedFilter.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) {
|
LaunchedEffect(accountViewModel, accountState.value?.account?.defaultStoriesFollowList) {
|
||||||
VideoFeedFilter.account = account
|
VideoFeedFilter.account = account
|
||||||
NostrVideoDataSource.account = account
|
NostrVideoDataSource.account = account
|
||||||
NostrVideoDataSource.resetFilters()
|
NostrVideoDataSource.resetFilters()
|
||||||
|
videoFeedView.invalidateData()
|
||||||
}
|
}
|
||||||
|
|
||||||
DisposableEffect(accountViewModel) {
|
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.fillMaxHeight()) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.padding(vertical = 0.dp)
|
modifier = Modifier.padding(vertical = 0.dp)
|
||||||
|
|||||||
Reference in New Issue
Block a user