58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
// Module ID: 10464
|
|
// Function ID: 10465
|
|
// Name: useShowChannelOptInNotice
|
|
// Dependencies: [4385, 676, 1379, 5789, 589, 5658, 2]
|
|
// Exports: default
|
|
|
|
// Module 10464 (useShowChannelOptInNotice)
|
|
import updateUserGuildSettingsInternal from "updateUserGuildSettingsInternal";
|
|
import { NULL_STRING_GUILD_ID } from "ME";
|
|
import { ChannelFlags } from "set";
|
|
|
|
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(5789).useOptInEnabledForGuild(null != guildId ? getGuildId.guild_id : NULL_STRING_GUILD_ID);
|
|
let tmpResult = tmp(589);
|
|
const items = [updateUserGuildSettingsInternal];
|
|
const stateFromStores = tmpResult.useStateFromStores(items, () => {
|
|
let result = null != closure_0;
|
|
if (result) {
|
|
result = outer1_2.isChannelRecordOrParentOptedIn(tmp);
|
|
}
|
|
return result;
|
|
});
|
|
tmpResult = tmp(5658);
|
|
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(5789);
|
|
};
|