/* Metro module 15406; source: modules/activities/utils/useTransitionToConnectedActivityInVoice.tsx; dependencies: [5, 31, 1379, 1934, 661, 3774, 8102, 10653, 8111, 1239, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as ComponentDispatchUtilsModule from '../../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */ function _fun117857(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:6, offset: 0x024c35a8, size: 191 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/activities/utils/useTransitionToConnectedActivityInVoice.tsx'); exports.default = useTransitionToConnectedActivityInVoice; function useTransitionToConnectedActivityInVoice({onTransition}) { // fn#117858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:276, offset: 0x024c3667, size: 52 bytes, params: 2, frame: 14 ReactModule.useEffect(function() { var closure = _fun117860; var env0_0 = closure; var env0_1 = _fun117861; var ComponentDispatch = require(dependencyMap[9]).ComponentDispatch; ComponentDispatch.subscribe(ComponentActions.OPEN_EMBEDDED_ACTIVITY, closure); return _fun117865; }, [onTransition]); function _fun117859() { // fn#117859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:356, offset: 0x024c369b, size: 86 bytes, params: 1, frame: 15 const closure = function() { return _handler.apply(this, arguments); }; let ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch; const subscribe = ComponentDispatch.subscribe; let OPEN_EMBEDDED_ACTIVITY = ComponentActions.OPEN_EMBEDDED_ACTIVITY; Reflect.apply(subscribe, ComponentDispatch, [OPEN_EMBEDDED_ACTIVITY, closure]); return function() { var ComponentDispatch = require(dependencyMap[9]).ComponentDispatch; var OPEN_EMBEDDED_ACTIVITY = ComponentActions.OPEN_EMBEDDED_ACTIVITY; ComponentDispatch.unsubscribe(OPEN_EMBEDDED_ACTIVITY, handler_117860); }; function handler_117860() { // fn#117860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:361, offset: 0x00c3b2ba, size: 30 bytes, params: 1, frame: 13 return _handler.apply(this, arguments); } function _handler() { // fn#117861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:418, offset: 0x024c36f1, size: 53 bytes, params: 1, frame: 13 var environment; const value = environment.__proto__.__proto__; return env2_3(_fun117863).apply(this, arguments); async function _fun117863({location}) { // fn#117863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:457, offset: 0x024c373a, size: 240 bytes, params: 2, frame: 19 var guild_id; var channel; if (false) { return undefined; } value = undefined; await value; if (false) { return undefined; } let binding = env4_0; const embeddedActivityLocationChannelId = binding(env4_2[5]).getEmbeddedActivityLocationChannelId(location); if (embeddedActivityLocationChannelId != null) { binding = env4_1; if (binding(env4_2[6])(embeddedActivityLocationChannelId)) { binding = env4_6; if (binding.getVoiceChannelId() === embeddedActivityLocationChannelId) { channel = env4_5.getChannel(embeddedActivityLocationChannelId); guild_id = channel == null ? value : channel.guild_id; global.setTimeout(_fun117864, 0); return value; } binding = env4_1; await binding(env4_2[7])({channelId: embeddedActivityLocationChannelId}); if (false) { return undefined; } binding = env4_5; channel = binding.getChannel(embeddedActivityLocationChannelId); guild_id = channel == null ? value : channel.guild_id; global.setTimeout(_fun117864, 0); return value; } } return value; function _fun117864() { // fn#117864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:679, offset: 0x024c382a, size: 65 bytes, params: 1, frame: 13 let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__; env5_1(env5_2[8])(guild_id, location); value = environment.__proto__.__proto__.__proto__.__proto__; if (require != null) { require(); } } } } function _fun117865() { // fn#117865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15603:819, offset: 0x024c386b, size: 62 bytes, params: 1, frame: 14 const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch; const unsubscribe = ComponentDispatch.unsubscribe; const OPEN_EMBEDDED_ACTIVITY = ComponentActions.OPEN_EMBEDDED_ACTIVITY; Reflect.apply(unsubscribe, ComponentDispatch, [OPEN_EMBEDDED_ACTIVITY, handler_117860]); } } } } global.__d(_fun117857, 15406, [5, 31, 1379, 1934, 661, 3774, 8102, 10653, 8111, 1239, 2]) /* metro module 15406, dependencies: [5, 31, 1379, 1934, 661, 3774, 8102, 10653, 8111, 1239, 2] */;