2026-09-24 10:59:02 +00:00
|
|
|
// Module ID: 10409
|
|
|
|
|
// Function ID: 10410
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useFetchStreamPreview
|
2026-09-24 10:59:02 +00:00
|
|
|
// Dependencies: [19, 4973, 2044, 4464, 2098, 1085, 504, 4971, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-24 10:59:02 +00:00
|
|
|
// Module 10409 (useFetchStreamPreview)
|
|
|
|
|
import StreamActionCreators from "StreamActionCreators" /* 4971 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import noop from "module_19" /* 19 */;
|
2026-09-24 10:59:02 +00:00
|
|
|
import ApplicationStreamPreviewStore from "ApplicationStreamPreviewStore" /* 4973 */;
|
|
|
|
|
import ChannelStore from "ChannelStore" /* 2044 */;
|
|
|
|
|
import PermissionStore from "PermissionStore" /* 4464 */;
|
|
|
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2098 */;
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const require = globalThis.__r;
|
|
|
|
|
|
|
|
|
|
require = fn;
|
|
|
|
|
const BasicPermissions = fn(1085).BasicPermissions;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/go_live/useFetchStreamPreview.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useFetchStreamPreview(arg0, arg1, arg2) {
|
2026-09-10 05:38:07 +00:00
|
|
|
_require = arg0;
|
2026-08-24 06:08:38 +00:00
|
|
|
dependencyMap = arg1;
|
2026-09-10 05:38:07 +00:00
|
|
|
noop = arg2;
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_3 = tmp;
|
|
|
|
|
const items = [closure_4];
|
2026-09-10 05:38:07 +00:00
|
|
|
closure_4 = require("initialize").useStateFromStores(items, () => ChannelStore.getChannel(closure_1));
|
|
|
|
|
let obj = require("initialize");
|
2026-07-23 10:11:24 +00:00
|
|
|
const items1 = [shouldFetchPreview];
|
2026-09-10 05:38:07 +00:00
|
|
|
let stateFromStores = require("initialize").useStateFromStores(items1, () => {
|
2026-08-24 06:08:38 +00:00
|
|
|
let canBasicChannelResult = null != closure_4;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (canBasicChannelResult) {
|
2026-09-10 05:38:07 +00:00
|
|
|
canBasicChannelResult = PermissionStore.canBasicChannel(BasicPermissions.CONNECT, tmp);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
return canBasicChannelResult;
|
|
|
|
|
});
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj2 = require("initialize");
|
2026-07-23 10:11:24 +00:00
|
|
|
const items2 = [stateFromStores];
|
2026-09-10 05:38:07 +00:00
|
|
|
const stateFromStores1 = require("initialize").useStateFromStores(items2, () => SelectedChannelStore.getVoiceChannelId() === closure_1);
|
|
|
|
|
const obj3 = require("initialize");
|
2026-08-24 06:08:38 +00:00
|
|
|
const items3 = [closure_3];
|
2026-09-10 05:38:07 +00:00
|
|
|
const stateFromStoresObject = require("initialize").useStateFromStoresObject(items3, () => {
|
|
|
|
|
let isPreviewLoading = !closure_3;
|
2026-07-29 08:29:29 +00:00
|
|
|
let shouldFetchPreviewResult = isPreviewLoading;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (!closure_3) {
|
|
|
|
|
shouldFetchPreviewResult = ApplicationStreamPreviewStore.shouldFetchPreview(closure_0, closure_1, closure_2);
|
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;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (!closure_3) {
|
|
|
|
|
previewURL = ApplicationStreamPreviewStore.getPreviewURL(closure_0, closure_1, closure_2);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj.previewUrl = previewURL;
|
|
|
|
|
if (!closure_3) {
|
|
|
|
|
isPreviewLoading = ApplicationStreamPreviewStore.getIsPreviewLoading(closure_0, closure_1, closure_2);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
obj.isLoading = 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];
|
2026-09-10 05:38:07 +00:00
|
|
|
const effect = noop.useEffect(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp = shouldFetchPreview;
|
|
|
|
|
if (shouldFetchPreview) {
|
2026-08-24 06:08:38 +00:00
|
|
|
tmp = !closure_3;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (tmp) {
|
|
|
|
|
tmp = stateFromStores;
|
|
|
|
|
}
|
|
|
|
|
if (tmp) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const streamPreview = StreamActionCreators.fetchStreamPreview(closure_0, closure_1, closure_2);
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}, items4);
|
|
|
|
|
if (!(null == arg1 || null == arg2)) {
|
|
|
|
|
if (stateFromStores) {
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj5 = { previewUrl, isLoading };
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
return obj5;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-22 07:41:18 +00:00
|
|
|
obj5 = { previewUrl: "flex", isLoading: true };
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|