decord/source/modules/opt_in_channels/useShowChannelOptInNotice.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

58 lines
1.8 KiB
TypeScript

// Module ID: 11427
// Function ID: 11428
// Name: useShowChannelOptInNotice
// Dependencies: [4741, 1074, 1964, 7535, 504, 7222, 2]
// Exports: default
// Module 11427 (useShowChannelOptInNotice)
import closure_2 from "updateUserGuildSettingsInternal" /* 4741 */;
import { NULL_STRING_GUILD_ID } from "ME" /* 1074 */;
import { ChannelFlags } from "set" /* 1964 */;
const require = arg1;
let result = require("set").fileFinishedImporting("modules/opt_in_channels/useShowChannelOptInNotice.tsx");
export default function useShowChannelOptInNotice(getGuildId) {
const _require = getGuildId;
let guildId;
if (getGuildId != null) {
guildId = getGuildId.getGuildId();
}
let optInEnabledForGuild = _require(7535).useOptInEnabledForGuild(null != guildId ? getGuildId.guild_id : NULL_STRING_GUILD_ID);
let tmpResult = tmp(504);
const items = [closure_2];
const stateFromStores = tmpResult.useStateFromStores(items, () => {
let result = null != closure_0;
if (result) {
result = closure_1_2.isChannelRecordOrParentOptedIn(tmp);
}
return result;
});
tmpResult = tmp(7222);
let guild_id;
if (getGuildId != null) {
guild_id = getGuildId.guild_id;
}
if (guild_id == null) {
guild_id = NULL_STRING_GUILD_ID;
}
let canSeeOnboardingHome = tmpResult.useCanSeeOnboardingHome(guild_id);
if (null == getGuildId) {
return false;
} else {
if (canSeeOnboardingHome) {
canSeeOnboardingHome = getGuildId.hasFlag(ChannelFlags.IS_GUILD_RESOURCE_CHANNEL);
}
if (optInEnabledForGuild) {
optInEnabledForGuild = !canSeeOnboardingHome;
}
if (optInEnabledForGuild) {
optInEnabledForGuild = !stateFromStores;
}
if (optInEnabledForGuild) {
optInEnabledForGuild = !getGuildId.isThread();
}
return optInEnabledForGuild;
}
const obj = _require(7535);
};