decord/source/modules/parent_tools/hooks/useIsOnMainSurface.native.tsx

83 lines
2.3 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 16064
// Function ID: 16065
2026-07-29 08:29:29 +00:00
// Name: getIsOnMainSurface
2026-08-08 06:10:11 +00:00
// Dependencies: [32, 19, 4159, 2]
2026-07-20 16:05:17 +00:00
// Exports: useIsOnMainSurface
2026-08-08 06:10:11 +00:00
// Module 16064 (getIsOnMainSurface)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import set from "getRootNavigationRef";
const require = arg1;
2026-07-20 16:05:17 +00:00
function getIsOnMainSurface() {
2026-07-29 08:29:29 +00:00
let index;
let index2;
let routes;
let routes2;
2026-08-08 06:10:11 +00:00
const rootNavigationRef = require(4159) /* getRootNavigationRef */.getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
2026-07-29 08:29:29 +00:00
const rootState = rootNavigationRef.getRootState();
let tmp2;
if (null != rootState) {
if (0 !== rootState.routes.length) {
({ index, routes } = rootState);
if (index == null) {
index = rootState.routes.length - 1;
}
tmp2 = routes[index];
}
}
2026-07-20 16:05:17 +00:00
let name;
2026-07-29 08:29:29 +00:00
if (tmp2 != null) {
2026-07-20 16:05:17 +00:00
name = tmp2.name;
}
if ("main" !== name) {
return false;
} else {
2026-07-29 08:29:29 +00:00
const state = tmp2.state;
let tmp4;
if (null != state) {
if (0 !== state.routes.length) {
({ index: index2, routes: routes2 } = state);
if (index2 == null) {
index2 = state.routes.length - 1;
}
tmp4 = routes2[index2];
}
}
let hasItem = null != tmp4;
2026-07-20 16:05:17 +00:00
if (hasItem) {
2026-07-29 08:29:29 +00:00
hasItem = set.has(tmp4.name);
2026-07-20 16:05:17 +00:00
}
return hasItem;
}
}
}
return false;
}
2026-07-23 10:11:24 +00:00
let set = new Set(["tabs", "channel"]);
2026-07-29 08:29:29 +00:00
const result = set.fileFinishedImporting("modules/parent_tools/hooks/useIsOnMainSurface.native.tsx");
2026-07-20 16:05:17 +00:00
export const useIsOnMainSurface = function useIsOnMainSurface() {
2026-07-23 10:11:24 +00:00
let require;
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
[tmp2, require] = callback(React.useState(getIsOnMainSurface), 2);
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
function handleNavigationChange() {
2026-07-29 08:29:29 +00:00
return rootNavigationRef(outer1_5());
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const rootNavigationRef = outer1_0(outer1_1[2]).getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
2026-07-29 08:29:29 +00:00
rootNavigationRef(outer1_5());
2026-07-20 16:05:17 +00:00
rootNavigationRef.addListener("state", handleNavigationChange);
return () => {
rootNavigationRef.removeListener("state", handleNavigationChange);
};
}
2026-07-23 10:11:24 +00:00
const obj = outer1_0(outer1_1[2]);
2026-07-20 16:05:17 +00:00
}, []);
return tmp2;
};