decord/source/modules/go_live/useFetchStreamPreview.tsx

88 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 10809
// Function ID: 10810
2026-07-20 16:05:17 +00:00
// Name: useFetchStreamPreview
2026-08-05 07:35:12 +00:00
// Dependencies: [19, 4436, 1372, 3883, 1931, 505, 589, 4434, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 10809 (useFetchStreamPreview)
2026-07-29 08:29:29 +00:00
import noop from "noop";
import reset from "reset";
import ensureGuildLoaded from "ensureGuildLoaded";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
import handleConnectionOpen from "handleConnectionOpen";
2026-07-23 10:11:24 +00:00
import { BasicPermissions } from "sum";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("ensureGuildLoaded").fileFinishedImporting("modules/go_live/useFetchStreamPreview.tsx");
2026-07-20 16:05:17 +00:00
export default function useFetchStreamPreview(arg0, arg1, arg2) {
let isLoading;
let previewUrl;
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
const dependencyMap = arg1;
const React = arg2;
2026-07-29 08:29:29 +00:00
let reset = tmp;
let obj = _require(589);
const items = [ensureGuildLoaded];
ensureGuildLoaded = obj.useStateFromStores(items, () => channel.getChannel(closure_1));
2026-07-23 10:11:24 +00:00
const items1 = [shouldFetchPreview];
2026-07-29 08:29:29 +00:00
let stateFromStores = _require(589).useStateFromStores(items1, () => {
let canBasicChannelResult = null != ensureGuildLoaded;
2026-07-20 16:05:17 +00:00
if (canBasicChannelResult) {
2026-07-29 08:29:29 +00:00
canBasicChannelResult = shouldFetchPreview.canBasicChannel(outer1_7.CONNECT, tmp);
2026-07-20 16:05:17 +00:00
}
return canBasicChannelResult;
});
2026-07-29 08:29:29 +00:00
const obj2 = _require(589);
2026-07-23 10:11:24 +00:00
const items2 = [stateFromStores];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = _require(589).useStateFromStores(items2, () => stateFromStores.getVoiceChannelId() === closure_1);
const obj3 = _require(589);
const items3 = [reset];
const stateFromStoresObject = _require(589).useStateFromStoresObject(items3, () => {
let isPreviewLoading = !tmp;
let shouldFetchPreviewResult = isPreviewLoading;
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-07-29 08:29:29 +00:00
shouldFetchPreviewResult = tmp.shouldFetchPreview(closure_0, closure_1, noop);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj = { shouldFetchPreview: shouldFetchPreviewResult, previewUrl: null, isLoading: null };
2026-07-20 16:05:17 +00:00
let previewURL = null;
if (!tmp) {
2026-07-29 08:29:29 +00:00
previewURL = tmp.getPreviewURL(closure_0, closure_1, noop);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = previewURL;
2026-07-20 16:05:17 +00:00
if (!tmp) {
2026-07-29 08:29:29 +00:00
isPreviewLoading = tmp.getIsPreviewLoading(closure_0, closure_1, noop);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = isPreviewLoading;
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-23 10:11:24 +00:00
shouldFetchPreview = stateFromStoresObject.shouldFetchPreview;
2026-07-20 16:05:17 +00:00
({ previewUrl, isLoading } = stateFromStoresObject);
if (!stateFromStores) {
stateFromStores = stateFromStores1;
}
const items4 = [shouldFetchPreview, arg1, arg0, arg2, null == arg1 || null == arg2, stateFromStores];
const effect = React.useEffect(() => {
let tmp = shouldFetchPreview;
if (shouldFetchPreview) {
2026-07-29 08:29:29 +00:00
tmp = !reset;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
tmp = stateFromStores;
}
if (tmp) {
2026-07-29 08:29:29 +00:00
const streamPreview = callback(table[7]).fetchStreamPreview(callback, table, noop);
2026-07-23 10:11:24 +00:00
const obj = callback(table[7]);
2026-07-20 16:05:17 +00:00
}
}, items4);
if (!(null == arg1 || null == arg2)) {
if (stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { previewUrl: null, isLoading: null };
obj[0] = previewUrl;
obj[1] = isLoading;
2026-07-20 16:05:17 +00:00
}
return obj;
}
2026-08-05 07:35:12 +00:00
obj = { previewUrl: "PX_8", isLoading: "Array" };
2026-07-20 16:05:17 +00:00
};