decord/beta/source/modules/activate_device/useActivateDeviceStepTracking.tsx

46 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 13420
// Function ID: 13421
// Name: useActivateDeviceStepTracking
// Dependencies: [19, 1074, 7720, 13421, 1241, 2]
// Exports: useActivateDeviceStepTracking
// Module 13420 (useActivateDeviceStepTracking)
2026-10-01 14:13:23 +00:00
import Constants from "Constants" /* 1074 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import usePreviousDefault from "usePrevious" /* 7720 */;
import ActivateDeviceUtils from "ActivateDeviceUtils" /* 13421 */;
2026-10-01 14:13:23 +00:00
import react from "react" /* 19 */;
import size from "module_2" /* 2 */;
2026-10-01 14:13:23 +00:00
let importDefault;
const AnalyticEvents = Constants.AnalyticEvents;
let result = size.fileFinishedImporting("modules/activate_device/useActivateDeviceStepTracking.tsx");
export const useActivateDeviceStepTracking = function useActivateDeviceStepTracking(arg0) {
2026-10-01 14:13:23 +00:00
let closure_1;
let type = arg0;
const tmp = usePreviousDefault(arg0);
importDefault = tmp;
const items = [tmp, arg0];
2026-10-01 14:13:23 +00:00
const effect = react.useEffect(() => {
if (type !== closure_1) {
let result = null;
2026-10-01 14:13:23 +00:00
const tmp3 = "user-code-input" !== tmp.type && "handoff" !== tmp.type;
if (tmp3) {
2026-10-01 14:13:23 +00:00
const obj = ActivateDeviceUtils;
result = obj.clientIdToActivateDevicePlatform(tmp.userCodeData.clientId);
}
2026-10-01 14:13:23 +00:00
type = undefined;
const track = AnalyticsUtilsDefault.track;
const DEVICE_LINK_STEP = AnalyticEvents.DEVICE_LINK_STEP;
AnalyticsUtilsDefault;
if (closure_1 != null) {
type = tmp2.type;
}
2026-10-01 14:13:23 +00:00
const obj2 = { previous_step: type, current_step: type.type, platform_type: result };
track(DEVICE_LINK_STEP, obj2);
}
}, items);
};