2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 16874
|
|
|
|
|
// Function ID: 16875
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useTransitionToConnectedActivityInVoice
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [5, 19, 2045, 2099, 1074, 4458, 8803, 8804, 8828, 1110, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 16874 (useTransitionToConnectedActivityInVoice)
|
2026-10-01 14:13:23 +00:00
|
|
|
import Constants from "Constants" /* 1074 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import ComponentDispatchUtils from "ComponentDispatchUtils" /* 1110 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
|
|
|
|
|
import react from "react" /* 19 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
|
|
|
import SelectedChannelStore from "SelectedChannelStore" /* 2099 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId, guild_id;
|
|
|
|
|
|
|
|
|
|
const ComponentActions = Constants.ComponentActions;
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/activities/utils/useTransitionToConnectedActivityInVoice.tsx");
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
export default function useTransitionToConnectedActivityInVoice(onTransition) {
|
2026-09-18 19:45:33 +00:00
|
|
|
onTransition = onTransition.onTransition;
|
|
|
|
|
const items = [onTransition];
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
function handler() {
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj(...arguments);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = function _handler() {
|
|
|
|
|
let channel;
|
|
|
|
|
let voiceChannelId;
|
|
|
|
|
obj = _asyncToGenerator(async (arg0) => {
|
|
|
|
|
const _location = arg0;
|
|
|
|
|
let c3 = 0;
|
|
|
|
|
let c4 = 0;
|
|
|
|
|
const iter = (async (arg0, value) => {
|
|
|
|
|
if (c4 === 2) {
|
|
|
|
|
c4 = 3;
|
|
|
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
|
|
|
} else if (tmp3 === 3) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
return { value, done: true };
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
return { value: "HermesInternal", done: null };
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
let location;
|
|
|
|
|
c4 = 2;
|
|
|
|
|
if (0 === c3) {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (arg0 === 1) {
|
|
|
|
|
c4 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c4 = 3;
|
2026-10-01 14:13:23 +00:00
|
|
|
return { value, done: true };
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
location = _location.location;
|
|
|
|
|
channelId = undefined;
|
|
|
|
|
guild_id = undefined;
|
|
|
|
|
c3 = 1;
|
|
|
|
|
c4 = 1;
|
|
|
|
|
return { value: "flex", done: true };
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (1 === c3) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
c4 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c4 = 3;
|
|
|
|
|
return { value, done: true };
|
|
|
|
|
} else {
|
|
|
|
|
const obj7 = handler(closure_2_2[5]);
|
|
|
|
|
channelId = obj7.getEmbeddedActivityLocationChannelId(location);
|
|
|
|
|
if (null != channelId) {
|
|
|
|
|
if (closure_2_1(closure_2_2[6])(channelId)) {
|
|
|
|
|
if (voiceChannelId.getVoiceChannelId() !== channelId) {
|
|
|
|
|
c3 = 2;
|
|
|
|
|
c4 = 1;
|
|
|
|
|
const obj5 = { channelId };
|
|
|
|
|
const obj6 = { value: closure_2_1(closure_2_2[7])(obj5), done: false };
|
|
|
|
|
return obj6;
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
c4 = 3;
|
|
|
|
|
return { value: "HermesInternal", done: null };
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
} else if (arg0 === 1) {
|
|
|
|
|
c4 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
2026-09-18 19:45:33 +00:00
|
|
|
c4 = 3;
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = { value, done: true };
|
|
|
|
|
return obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
channel.getChannel(channelId);
|
|
|
|
|
guild_id = undefined;
|
|
|
|
|
if (guild_id != null) {
|
|
|
|
|
guild_id = guild_id.guild_id;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const _setTimeout = setTimeout;
|
|
|
|
|
const timerId = setTimeout(() => {
|
|
|
|
|
obj(closure_3_2[8])(closure_1_3, closure_1_0);
|
|
|
|
|
if (closure_0 != null) {
|
|
|
|
|
closure_0();
|
|
|
|
|
}
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
} catch (tmp24) {
|
|
|
|
|
c4 = 3;
|
|
|
|
|
throw tmp24;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
})();
|
|
|
|
|
iter.next();
|
|
|
|
|
return iter;
|
|
|
|
|
});
|
|
|
|
|
return obj(...arguments);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|
2026-09-26 17:57:22 +00:00
|
|
|
let ComponentDispatch = onTransition(dependencyMap[9]).ComponentDispatch;
|
2026-09-18 19:45:33 +00:00
|
|
|
const subscription = ComponentDispatch.subscribe(constants.OPEN_EMBEDDED_ACTIVITY, handler);
|
|
|
|
|
return () => {
|
|
|
|
|
const ComponentDispatch = ComponentDispatchUtils.ComponentDispatch;
|
|
|
|
|
ComponentDispatch.unsubscribe(ComponentActions.OPEN_EMBEDDED_ACTIVITY, handler);
|
|
|
|
|
};
|
|
|
|
|
}, items);
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|