Shell behaviors update (react-query refactor) (#1915)
* Move tick-every-minute into a hook/context * Move soft-reset event out of the shell model * Update soft-reset listener on new search page * Implement session-loaded and session-dropped events * Update analytics and push-notifications to use new session system
This commit is contained in:
parent
f23e9978d8
commit
6616b2bff0
20 changed files with 186 additions and 136 deletions
|
@ -9,15 +9,14 @@ import {FollowingEndOfFeed} from 'view/com/posts/FollowingEndOfFeed'
|
|||
import {CustomFeedEmptyState} from 'view/com/posts/CustomFeedEmptyState'
|
||||
import {FeedsTabBar} from '../com/pager/FeedsTabBar'
|
||||
import {Pager, PagerRef, RenderTabBarFnProps} from 'view/com/pager/Pager'
|
||||
import {useStores} from 'state/index'
|
||||
import {FeedPage} from 'view/com/feeds/FeedPage'
|
||||
import {useSetMinimalShellMode, useSetDrawerSwipeDisabled} from '#/state/shell'
|
||||
import {usePreferencesQuery} from '#/state/queries/preferences'
|
||||
import {emitSoftReset} from '#/state/events'
|
||||
|
||||
type Props = NativeStackScreenProps<HomeTabNavigatorParams, 'Home'>
|
||||
export const HomeScreen = withAuthRequired(
|
||||
observer(function HomeScreenImpl({}: Props) {
|
||||
const store = useStores()
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const setDrawerSwipeDisabled = useSetDrawerSwipeDisabled()
|
||||
const pagerRef = React.useRef<PagerRef>(null)
|
||||
|
@ -74,8 +73,8 @@ export const HomeScreen = withAuthRequired(
|
|||
)
|
||||
|
||||
const onPressSelected = React.useCallback(() => {
|
||||
store.emitScreenSoftReset()
|
||||
}, [store])
|
||||
emitSoftReset()
|
||||
}, [])
|
||||
|
||||
const onPageScrollStateChanged = React.useCallback(
|
||||
(state: 'idle' | 'dragging' | 'settling') => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue