decord/source/modules/quests/native/BountiesModal/useBountyVideoProgressPersistence.tsx
github-actions 8d58bae3b2 chore: update source for alpha 347.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4907.js (118.4 MB)
2026-09-18 06:58:00 +00:00

59 lines
2.4 KiB
TypeScript

// Module ID: 15237
// Function ID: 15238
// Name: useBountyVideoProgressPersistence
// Dependencies: [32, 19, 7898, 15235, 11765, 2]
// Exports: useBountyVideoProgressPersistence
// Module 15237 (useBountyVideoProgressPersistence)
import BountyActionCreators from "BountyActionCreators" /* 11765 */;
import useBountiesModalTiming from "useBountiesModalTiming" /* 15235 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
import BountyStore from "BountyStore" /* 7898 */;
require = fn;
let closure_5 = { timestampSec: 0, maxTimestampSec: 0, duration: 0 };
const size = fn(2);
let result = size.fileFinishedImporting("modules/quests/native/BountiesModal/useBountyVideoProgressPersistence.tsx");
export const useBountyVideoProgressPersistence = function useBountyVideoProgressPersistence(bountyId) {
bountyId = bountyId.bountyId;
const endMode = bountyId.endMode;
_slicedToArray = undefined;
noop = undefined;
const first = _slicedToArray(noop.useState(() => {
let bountyVideoProgress = BountyStore.getBountyVideoProgress(bountyId);
if (null != bountyVideoProgress) {
if (endMode === useBountiesModalTiming.BountyVideoEndMode.LOOP) {
const duration = bountyVideoProgress.duration;
let tmp6 = duration > 0;
if (tmp6) {
tmp6 = tmp5 >= duration - 1;
}
return bountyVideoProgress;
}
}
bountyVideoProgress = closure_5;
}), 1)[0];
_slicedToArray = noop.useRef(0);
noop = noop.useRef(first.timestampSec);
noop.useRef(first.maxTimestampSec);
noop.useRef(first.duration);
let obj = { initialProgress: first, handleProgress: null, flushProgress: null };
const items = [bountyId];
obj.handleProgress = noop.useCallback((current, current2, current3) => {
closure_3.current = current3;
closure_4.current = current;
closure_5.current = current2;
if (current3 >= ref.current) {
tmp.current = current3 + 1;
const obj2 = { timestampSec: current3, maxTimestampSec: current, duration: current2 };
const result = BountyActionCreators.setBountyVideoProgress(bountyId, obj2);
}
}, items);
const items1 = [bountyId];
obj.flushProgress = noop.useCallback(() => {
const result = BountyActionCreators.setBountyVideoProgress(bountyId, { timestampSec: ref2.current, maxTimestampSec: ref3.current, duration: ref4.current });
}, items1);
return obj;
};