// Module ID: 10306 // Function ID: 10307 // Name: useFetchStreamPreview // Dependencies: [19, 4866, 1958, 4361, 2012, 1085, 504, 4864, 2] // Exports: default // Module 10306 (useFetchStreamPreview) import StreamActionCreators from "StreamActionCreators" /* 4864 */; import noop from "module_19" /* 19 */; import ApplicationStreamPreviewStore from "ApplicationStreamPreviewStore" /* 4866 */; import ChannelStore from "ChannelStore" /* 1958 */; import PermissionStore from "PermissionStore" /* 4361 */; import SelectedChannelStore from "SelectedChannelStore" /* 2012 */; 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 }; };