diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/HomeScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/HomeScreen.kt index e859f23d2..10130e4c6 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/HomeScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/HomeScreen.kt @@ -60,6 +60,8 @@ fun HomeScreen( HomeNewThreadFeedFilter.account = account HomeConversationsFeedFilter.account = account NostrHomeDataSource.invalidateFilters() + homeFeedViewModel.invalidateData(true) + repliesFeedViewModel.invalidateData(true) } if (wantsToAddNip47 != null) { diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/NotificationScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/NotificationScreen.kt index 90089e97c..c2e639701 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/NotificationScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/NotificationScreen.kt @@ -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) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt index b12ebcb66..3c8541185 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/VideoScreen.kt @@ -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)