Fix: correctly identify if the screen is focused when handling soft resets on post feeds (#2100)
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user