Tune feed loading behavior (#528)

* Never autoload home feed on focus

* On web, just check for new notifications on focus

* Switching tab in the home feed now checks for latest
This commit is contained in:
Paul Frazee 2023-04-24 19:41:27 -05:00 committed by GitHub
parent 7a10762716
commit f4da2f4442
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 17 deletions

View file

@ -16,6 +16,7 @@ import {useOnMainScroll} from 'lib/hooks/useOnMainScroll'
import {useTabFocusEffect} from 'lib/hooks/useTabFocusEffect'
import {s} from 'lib/styles'
import {useAnalytics} from 'lib/analytics'
import {isWeb} from 'platform/detection'
type Props = NativeStackScreenProps<
NotificationsTabNavigatorParams,
@ -70,10 +71,14 @@ export const NotificationsScreen = withAuthRequired(
// essentially equivalent to useFocusEffect because we dont used tabbed
// navigation
if (isInside) {
if (store.me.notifications.unreadCount > 0) {
store.me.notifications.refresh()
} else {
if (isWeb) {
store.me.notifications.syncQueue()
} else {
if (store.me.notifications.unreadCount > 0) {
store.me.notifications.refresh()
} else {
store.me.notifications.syncQueue()
}
}
}
},