decord/alpha/source/modules/rtc/hooks/useIsSecureFramesKeyInconsistent.tsx

59 lines
2.3 KiB
TypeScript
Raw Normal View History

// Module ID: 9400
// Function ID: 9401
2026-07-20 16:05:17 +00:00
// Name: useIsSecureFramesKeyInconsistent
// Dependencies: [19, 4745, 4761, 504, 9388, 2]
2026-07-29 08:29:29 +00:00
// Exports: useAlertIfSecureFramesKeyInconsistent, useIsSecureFramesKeyInconsistent
2026-07-20 16:05:17 +00:00
// Module 9400 (useIsSecureFramesKeyInconsistent)
import SecureFramesUtils from "SecureFramesUtils" /* 9388 */;
import noop from "module_19" /* 19 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4745 */;
import StreamRTCConnectionStore from "StreamRTCConnectionStore" /* 4761 */;
2026-07-20 16:05:17 +00:00
require = fn;
const size = fn(2);
let result = size.fileFinishedImporting("modules/rtc/hooks/useIsSecureFramesKeyInconsistent.tsx");
2026-07-29 08:29:29 +00:00
export const useIsSecureFramesKeyInconsistent = function useIsSecureFramesKeyInconsistent(userId) {
2026-07-23 10:11:24 +00:00
userId = userId.userId;
const items = [RTCConnectionStore, StreamRTCConnectionStore];
return userId(504).useStateFromStores(items, () => {
const items = [RTCConnectionStore, StreamRTCConnectionStore];
return SecureFramesUtils.getIsSecureFramesKeyInconsistent(channelId, items);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const useAlertIfSecureFramesKeyInconsistent = function useAlertIfSecureFramesKeyInconsistent(channelId) {
channelId = channelId.channelId;
const userId = channelId.userId;
2026-07-20 16:05:17 +00:00
const nickname = channelId.nickname;
const onAlertOpen = channelId.onAlertOpen;
2026-07-29 08:29:29 +00:00
let stateFromStores;
closure_129_0 = userId;
2026-07-29 08:29:29 +00:00
let items = [onAlertOpen, stateFromStores];
stateFromStores = channelId(userId[3]).useStateFromStores(items, () => {
const items = [RTCConnectionStore, StreamRTCConnectionStore];
return SecureFramesUtils.getIsSecureFramesKeyInconsistent(channelId, items);
2026-07-29 08:29:29 +00:00
});
nickname.useRef(null);
2026-07-29 08:29:29 +00:00
const items1 = [channelId, stateFromStores, nickname, onAlertOpen, userId];
2026-07-23 10:11:24 +00:00
const effect = nickname.useEffect(() => {
2026-07-29 08:29:29 +00:00
if (stateFromStores) {
2026-07-20 16:05:17 +00:00
if (null == ref.current) {
const _setTimeout = setTimeout;
2026-07-29 08:29:29 +00:00
tmp.current = setTimeout(() => {
onAlertOpen();
const result = channelId(userId[4]).showSecureFramesKeyInconsistentAlert({ userId, channelId: current, nickname });
2026-07-20 16:05:17 +00:00
}, 1000);
2026-07-29 08:29:29 +00:00
let tmp3 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const current = tmp3.current;
2026-07-20 16:05:17 +00:00
return () => {
clearTimeout(current);
};
}
2026-07-29 08:29:29 +00:00
tmp3 = ref;
2026-07-20 16:05:17 +00:00
clearTimeout(ref.current);
ref.current = null;
2026-07-29 08:29:29 +00:00
}, items1);
2026-07-20 16:05:17 +00:00
};