decord/source/modules/activities/useIframeLifecycle.tsx
2026-08-08 06:10:11 +00:00

71 lines
2 KiB
TypeScript

// Module ID: 10727
// Function ID: 10728
// Name: useIframeLifecycle
// Dependencies: [19, 676, 1231, 2]
// Exports: default
// Module 10727 (useIframeLifecycle)
import noop from "noop";
import { ComponentActions } from "ME";
const require = arg1;
const result = require("ComponentDispatcher").fileFinishedImporting("modules/activities/useIframeLifecycle.tsx");
export default function useIframeLifecycle(arg0) {
let closure_0 = arg0;
let obj = arg1;
if (arg1 === undefined) {
obj = {};
}
const onIframeMount = obj.onIframeMount;
const onIframeUnmount = obj.onIframeUnmount;
let flag = obj.isNewIframe;
if (flag === undefined) {
flag = true;
}
let flag2 = obj.isIframeRetiring;
if (flag2 === undefined) {
flag2 = true;
}
let closure_5;
let closure_6;
let closure_7;
let closure_8;
closure_5 = onIframeUnmount.useRef(onIframeMount);
closure_6 = onIframeUnmount.useRef(onIframeUnmount);
closure_7 = onIframeUnmount.useRef(flag);
closure_8 = onIframeUnmount.useRef(flag2);
const effect = onIframeUnmount.useEffect(() => {
closure_5.current = onIframeMount;
closure_6.current = onIframeUnmount;
closure_7.current = flag;
closure_8.current = flag2;
});
const items = [arg0];
const effect1 = onIframeUnmount.useEffect(() => {
if (ref2.current) {
let ComponentDispatch = callback(onIframeMount[2]).ComponentDispatch;
let obj = { id: null };
obj[0] = callback;
ComponentDispatch.dispatch(flag.IFRAME_MOUNT, obj);
let current = ref.current;
if (current != null) {
current(tmp4);
}
tmp4 = callback;
}
return () => {
if (ref2.current) {
const ComponentDispatch = outer1_0(outer1_1[2]).ComponentDispatch;
const obj = { id: null };
obj[0] = closure_0;
ComponentDispatch.dispatch(outer1_3.IFRAME_UNMOUNT, obj);
const current = ref.current;
if (current != null) {
current(tmp4);
}
tmp4 = closure_0;
}
};
}, items);
};