Fix: correctly identify if the screen is focused when handling soft resets on post feeds (#2100)
This commit is contained in:
parent
3c8036587e
commit
826b841e10
4 changed files with 26 additions and 13 deletions
|
@ -1,5 +1,15 @@
|
|||
import {NavigationProp} from '@react-navigation/native'
|
||||
import {State, RouteParams} from './types'
|
||||
|
||||
export function getRootNavigation<T>(
|
||||
nav: NavigationProp<T>,
|
||||
): NavigationProp<T> {
|
||||
while (nav.getParent()) {
|
||||
nav = nav.getParent()
|
||||
}
|
||||
return nav
|
||||
}
|
||||
|
||||
export function getCurrentRoute(state: State) {
|
||||
let node = state.routes[state.index || 0]
|
||||
while (node.state?.routes && typeof node.state?.index === 'number') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue