decord/source/modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx

31 lines
851 B
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 14001
// Function ID: 14002
2026-07-20 16:05:17 +00:00
// Name: useRefreshLinkCodeOnExpiry
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 8274, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 14001 (useRefreshLinkCodeOnExpiry)
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/parent_tools/hooks/useRefreshLinkCodeOnExpiry.tsx");
2026-07-20 16:05:17 +00:00
export default function useRefreshLinkCodeOnExpiry(arg0, arg1) {
const importDefault = arg0;
2026-08-05 07:35:12 +00:00
const tmp = importDefault(8274)(arg1);
2026-07-20 16:05:17 +00:00
const dependencyMap = tmp;
const items = [arg0, tmp];
const effect = React.useEffect(() => {
if (null != timeout) {
const _Date = Date;
2026-07-29 08:29:29 +00:00
const diff = tmp - Date.now();
2026-07-20 16:05:17 +00:00
if (diff <= 0) {
tmp();
} else {
const _setTimeout = setTimeout;
2026-07-23 10:11:24 +00:00
timeout = setTimeout(tmp, diff);
2026-07-20 16:05:17 +00:00
return () => clearTimeout(closure_0);
}
}
}, items);
};