decord/source/modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

106 lines
3.3 KiB
TypeScript

// Module ID: 12272
// Function ID: 12273
// Name: useIsPrimaryEntryPointDisabled
// Dependencies: [1918, 4275, 1085, 504, 9712, 12186, 9676, 9540, 1150, 1114, 2]
// Exports: default
// Module 12272 (useIsPrimaryEntryPointDisabled)
import getPlatformDefault from "getPlatform" /* 9540 */;
import ApplicationRecord from "ApplicationRecord" /* 1918 */;
import PermissionStore from "PermissionStore" /* 4275 */;
const require = fn;
const Permissions = fn(1085).Permissions;
const size = fn(2);
const result = size.fileFinishedImporting("modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx");
export default function useIsPrimaryEntryPointDisabled(arg0) {
({ context, application, activityAction } = arg0);
let channel;
if ("channel" === context.type) {
channel = context.channel;
}
const items = [PermissionStore];
const stateFromStores = channel(504).useStateFromStores(items, () => PermissionStore.can(Permissions.USE_EMBEDDED_ACTIVITIES, channel));
const obj = channel(504);
let id;
if (channel != null) {
id = channel.id;
}
const embeddedActivityLaunchability = channel(9712).useEmbeddedActivityLaunchability(id);
let flag = false;
if (channel(12186).ActivityAction.LEAVE !== activityAction) {
if (tmp2(12186).ActivityAction.START === activityAction) {
flag = false;
if (null != channel) {
let isGuildVoiceResult;
if (channel != null) {
isGuildVoiceResult = channel.isGuildVoice();
}
if (isGuildVoiceResult) {
flag = false;
if (embeddedActivityLaunchability !== tmp2(9712).EmbeddedActivityLaunchability.CAN_LAUNCH) {
flag = true;
}
} else {
flag = false;
if (!tmp2Result.isActivitiesInTextEnabled(channel)) {
flag = true;
}
tmp2Result = tmp2(9676);
}
}
} else {
flag = false;
if (tmp2(12186).ActivityAction.JOIN === activityAction) {
let isGuildVoiceResult1;
if (channel != null) {
isGuildVoiceResult1 = channel.isGuildVoice();
}
if (isGuildVoiceResult1) {
flag = !stateFromStores;
} else {
flag = false;
if (!tmp2Result3.isActivitiesInTextEnabled(channel)) {
flag = true;
}
tmp2Result3 = tmp2(9676);
}
}
}
}
let disabled = flag;
let reason;
if (activityAction !== channel(12186).ActivityAction.LEAVE) {
const tmp10 = application instanceof ApplicationRecord ? application.embeddedActivityConfig : application.embedded_activity_config;
getPlatformDefault;
tmp2(1150);
if (null != tmp10) {
const supported_platforms = tmp10.supported_platforms;
if (!supported_platforms.includes(tmp14)) {
const intl = tmp2(1114).intl;
reason = intl.string(tmp2(1114).t.z2YTgJ);
disabled = false;
}
}
let isThreadResult;
if (channel != null) {
isThreadResult = channel.isThread();
}
disabled = flag;
if (isThreadResult) {
const intl2 = tmp2(1114).intl;
reason = intl2.string(tmp2(1114).t.ddSR3v);
disabled = true;
}
}
let tmp16 = disabled;
if (disabled) {
tmp16 = null == reason;
}
if (tmp16) {
const intl3 = tmp2(1114).intl;
reason = intl3.string(tmp2(1114).t.f41E1g);
}
return { disabled, reason };
};