decord/source/modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx

107 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11372
// Function ID: 11373
2026-07-20 16:05:17 +00:00
// Name: useIsPrimaryEntryPointDisabled
2026-08-24 06:08:38 +00:00
// Dependencies: [4483, 4024, 505, 589, 11169, 11281, 8485, 8755, 500, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 11372 (useIsPrimaryEntryPointDisabled)
import getPlatformDefault from "getPlatform" /* 8755 */;
import closure_3 from "createExecutable" /* 4483 */;
import closure_4 from "getUncachedChannelPermissions" /* 4024 */;
import { Permissions } from "sum" /* 505 */;
2026-07-20 16:05:17 +00:00
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/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx");
2026-07-20 16:05:17 +00:00
export default function useIsPrimaryEntryPointDisabled(arg0) {
({ context, application, activityAction } = arg0);
let channel;
2026-07-23 10:11:24 +00:00
channel = undefined;
2026-07-20 16:05:17 +00:00
if ("channel" === context.type) {
channel = context.channel;
}
2026-08-24 06:08:38 +00:00
const items = [closure_4];
const stateFromStores = channel(589).useStateFromStores(items, () => closure_1_4.can(closure_1_5.USE_EMBEDDED_ACTIVITIES, channel));
2026-07-29 08:29:29 +00:00
const obj = channel(589);
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
2026-08-24 06:08:38 +00:00
const embeddedActivityLaunchability = channel(11169).useEmbeddedActivityLaunchability(id);
2026-07-20 16:05:17 +00:00
let flag = false;
2026-08-24 06:08:38 +00:00
if (channel(11281).ActivityAction.LEAVE !== activityAction) {
if (tmp2(11281).ActivityAction.START === activityAction) {
2026-07-20 16:05:17 +00:00
flag = false;
if (null != channel) {
2026-07-29 08:29:29 +00:00
let isGuildVoiceResult;
if (channel != null) {
isGuildVoiceResult = channel.isGuildVoice();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isGuildVoiceResult) {
flag = false;
2026-08-24 06:08:38 +00:00
if (embeddedActivityLaunchability !== tmp2(11169).EmbeddedActivityLaunchability.CAN_LAUNCH) {
2026-07-29 08:29:29 +00:00
flag = true;
}
} else {
2026-08-24 06:08:38 +00:00
let tmp2Result = tmp2(8485);
2026-07-29 08:29:29 +00:00
flag = false;
if (!tmp2Result.isActivitiesInTextEnabled(channel)) {
flag = true;
}
2026-07-20 16:05:17 +00:00
}
}
} else {
flag = false;
2026-08-24 06:08:38 +00:00
if (tmp2(11281).ActivityAction.JOIN === activityAction) {
2026-07-29 08:29:29 +00:00
let isGuildVoiceResult1;
if (channel != null) {
isGuildVoiceResult1 = channel.isGuildVoice();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isGuildVoiceResult1) {
flag = !stateFromStores;
} else {
2026-08-24 06:08:38 +00:00
tmp2Result = tmp2(8485);
2026-07-29 08:29:29 +00:00
flag = false;
if (!tmp2Result.isActivitiesInTextEnabled(channel)) {
flag = true;
}
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
let disabled = flag;
let reason;
2026-08-24 06:08:38 +00:00
if (activityAction !== channel(11281).ActivityAction.LEAVE) {
const tmp10 = application instanceof closure_3 ? application.embeddedActivityConfig : application.embedded_activity_config;
getPlatformDefault;
2026-07-29 08:29:29 +00:00
tmp2(500);
if (null != tmp10) {
const supported_platforms = tmp10.supported_platforms;
if (!supported_platforms.includes(tmp14)) {
const intl = tmp2(1236).intl;
reason = intl.string(tmp2(1236).t.z2YTgJ);
disabled = false;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let isThreadResult;
if (channel != null) {
isThreadResult = channel.isThread();
}
disabled = flag;
if (isThreadResult) {
const intl2 = tmp2(1236).intl;
reason = intl2.string(tmp2(1236).t.ddSR3v);
disabled = true;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
let tmp16 = disabled;
if (disabled) {
tmp16 = null == reason;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp16) {
const intl3 = tmp2(1236).intl;
reason = intl3.string(tmp2(1236).t.f41E1g);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return { disabled, reason };
2026-07-20 16:05:17 +00:00
};