decord/source/modules/activities/utils/useTransitionToConnectedActivityInVoice.tsx

146 lines
5.1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16398
// Function ID: 16399
2026-07-20 16:05:17 +00:00
// Name: useTransitionToConnectedActivityInVoice
2026-08-25 06:04:03 +00:00
// Dependencies: [5, 19, 1391, 1981, 676, 4015, 10475, 10725, 10736, 1231, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 16398 (useTransitionToConnectedActivityInVoice)
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "noop" /* 19 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
2026-08-25 06:04:03 +00:00
import closure_6 from "handleConnectionOpen" /* 1981 */;
2026-08-24 06:08:38 +00:00
import { ComponentActions } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/activities/utils/useTransitionToConnectedActivityInVoice.tsx");
2026-07-20 16:05:17 +00:00
export default function useTransitionToConnectedActivityInVoice(onTransition) {
onTransition = onTransition.onTransition;
const items = [onTransition];
const effect = React.useEffect(() => {
function handler() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _handler.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _handler() {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = closure_2_3((arg0) => {
closure_0 = arg0;
c3 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-25 06:04:03 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c4 = 2;
if (0 === guild_id) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
guild_id = tmp5;
let callback = tmp2;
let location;
location = location.location;
callback = undefined;
guild_id = undefined;
guild_id = undefined;
guild_id = 1;
c4 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-07-29 08:29:29 +00:00
}
} else {
if (1 === tmp5) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
2026-08-24 06:08:38 +00:00
callback = closure_2_0(closure_2_2[5]).getEmbeddedActivityLocationChannelId(location);
2026-07-29 08:29:29 +00:00
if (null != callback) {
2026-08-24 06:08:38 +00:00
if (callback(closure_2_2[6])(callback)) {
if (closure_2_6.getVoiceChannelId() !== callback) {
2026-07-29 08:29:29 +00:00
const obj2 = { channelId: null };
obj2[0] = callback;
guild_id = 2;
c4 = 1;
const obj3 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj3[0] = callback(closure_2_2[7])(obj2);
2026-07-29 08:29:29 +00:00
return obj3;
}
}
}
c4 = 3;
2026-08-25 06:04:03 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
2026-08-24 06:08:38 +00:00
guild_id = closure_2_5.getChannel(callback);
2026-07-29 08:29:29 +00:00
guild_id = undefined;
if (guild_id != null) {
guild_id = guild_id.guild_id;
}
const _setTimeout = setTimeout;
const timerId = setTimeout(() => { ... }, 0);
}
} catch (tmp25) {
c4 = tmp;
throw tmp25;
}
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_1 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let ComponentDispatch = onTransition(closure_1_2[9]).ComponentDispatch;
const subscription = ComponentDispatch.subscribe(closure_1_7.OPEN_EMBEDDED_ACTIVITY, handler);
2026-07-20 16:05:17 +00:00
return () => {
2026-08-24 06:08:38 +00:00
const ComponentDispatch = onTransition(closure_2_2[9]).ComponentDispatch;
ComponentDispatch.unsubscribe(closure_2_7.OPEN_EMBEDDED_ACTIVITY, handler);
2026-07-20 16:05:17 +00:00
};
}, items);
};