Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4745.js (118.4 MB)
86 lines
3.3 KiB
TypeScript
86 lines
3.3 KiB
TypeScript
// Module ID: 10067
|
|
// Function ID: 10068
|
|
// Name: useFetchStreamPreview
|
|
// Dependencies: [19, 4704, 1957, 4199, 2011, 1085, 504, 4702, 2]
|
|
// Exports: default
|
|
|
|
// Module 10067 (useFetchStreamPreview)
|
|
import StreamActionCreators from "StreamActionCreators" /* 4702 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import ApplicationStreamPreviewStore from "ApplicationStreamPreviewStore" /* 4704 */;
|
|
import ChannelStore from "ChannelStore" /* 1957 */;
|
|
import PermissionStore from "PermissionStore" /* 4199 */;
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2011 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
const BasicPermissions = fn(1085).BasicPermissions;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/go_live/useFetchStreamPreview.tsx");
|
|
|
|
export default function useFetchStreamPreview(arg0, arg1, arg2) {
|
|
_require = arg0;
|
|
dependencyMap = arg1;
|
|
noop = arg2;
|
|
closure_3 = tmp;
|
|
const items = [closure_4];
|
|
closure_4 = require("initialize").useStateFromStores(items, () => ChannelStore.getChannel(closure_1));
|
|
let obj = require("initialize");
|
|
const items1 = [shouldFetchPreview];
|
|
let stateFromStores = require("initialize").useStateFromStores(items1, () => {
|
|
let canBasicChannelResult = null != closure_4;
|
|
if (canBasicChannelResult) {
|
|
canBasicChannelResult = PermissionStore.canBasicChannel(BasicPermissions.CONNECT, tmp);
|
|
}
|
|
return canBasicChannelResult;
|
|
});
|
|
const obj2 = require("initialize");
|
|
const items2 = [stateFromStores];
|
|
const stateFromStores1 = require("initialize").useStateFromStores(items2, () => SelectedChannelStore.getVoiceChannelId() === closure_1);
|
|
const obj3 = require("initialize");
|
|
const items3 = [closure_3];
|
|
const stateFromStoresObject = require("initialize").useStateFromStoresObject(items3, () => {
|
|
let isPreviewLoading = !closure_3;
|
|
let shouldFetchPreviewResult = isPreviewLoading;
|
|
if (!closure_3) {
|
|
shouldFetchPreviewResult = ApplicationStreamPreviewStore.shouldFetchPreview(closure_0, closure_1, closure_2);
|
|
}
|
|
const obj = { shouldFetchPreview: shouldFetchPreviewResult, previewUrl: null, isLoading: null };
|
|
let previewURL = null;
|
|
if (!closure_3) {
|
|
previewURL = ApplicationStreamPreviewStore.getPreviewURL(closure_0, closure_1, closure_2);
|
|
}
|
|
obj.previewUrl = previewURL;
|
|
if (!closure_3) {
|
|
isPreviewLoading = ApplicationStreamPreviewStore.getIsPreviewLoading(closure_0, closure_1, closure_2);
|
|
}
|
|
obj.isLoading = isPreviewLoading;
|
|
return obj;
|
|
});
|
|
shouldFetchPreview = stateFromStoresObject.shouldFetchPreview;
|
|
({ previewUrl, isLoading } = stateFromStoresObject);
|
|
if (!stateFromStores) {
|
|
stateFromStores = stateFromStores1;
|
|
}
|
|
const items4 = [shouldFetchPreview, arg1, arg0, arg2, null == arg1 || null == arg2, stateFromStores];
|
|
const effect = noop.useEffect(() => {
|
|
let tmp = shouldFetchPreview;
|
|
if (shouldFetchPreview) {
|
|
tmp = !closure_3;
|
|
}
|
|
if (tmp) {
|
|
tmp = stateFromStores;
|
|
}
|
|
if (tmp) {
|
|
const streamPreview = StreamActionCreators.fetchStreamPreview(closure_0, closure_1, closure_2);
|
|
}
|
|
}, items4);
|
|
if (!(null == arg1 || null == arg2)) {
|
|
if (stateFromStores) {
|
|
let obj5 = { previewUrl, isLoading };
|
|
}
|
|
return obj5;
|
|
}
|
|
obj5 = { previewUrl: "PX_16", isLoading: true };
|
|
};
|