decord/alpha/source/modules/welcome_screen/useWelcomeScreenEnabled.tsx

52 lines
1.8 KiB
TypeScript
Raw Normal View History

// Module ID: 12365
// Function ID: 12366
2026-07-20 16:05:17 +00:00
// Name: useWelcomeScreenEnabled
// Dependencies: [2048, 2044, 2066, 2098, 1074, 504, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 12365 (useWelcomeScreenEnabled)
import Constants from "Constants" /* 1074 */;
import ChannelRecord from "ChannelRecord" /* 2048 */;
import ChannelStore from "ChannelStore" /* 2044 */;
import GuildStore from "GuildStore" /* 2066 */;
import SelectedChannelStore from "SelectedChannelStore" /* 2098 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const isGuildTextChannelType = ChannelRecord.isGuildTextChannelType;
const GuildFeatures = Constants.GuildFeatures;
const result = size.fileFinishedImporting("modules/welcome_screen/useWelcomeScreenEnabled.tsx");
2026-07-20 16:05:17 +00:00
export default function useWelcomeScreenEnabled(arg0, arg1) {
_require = arg0;
2026-08-24 06:08:38 +00:00
dependencyMap = arg1;
const items = [ChannelStore, GuildStore, SelectedChannelStore];
return require("initialize").useStateFromStores(items, () => {
const guild = GuildStore.getGuild(closure_1);
2026-07-20 16:05:17 +00:00
let hasItem;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
hasItem = features.has(GuildFeatures.WELCOME_SCREEN_ENABLED);
2026-07-20 16:05:17 +00:00
}
if (true === hasItem) {
const features2 = guild.features;
if (features2.has(GuildFeatures.COMMUNITY)) {
2026-07-20 16:05:17 +00:00
const features3 = guild.features;
2026-07-29 08:29:29 +00:00
if (features3.has(tmp5.GUILD_SERVER_GUIDE)) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const channel = ChannelStore.getChannel(closure_0);
let tmp9 = closure_0 === SelectedChannelStore.getChannelId(closure_1) && null != channel && channel.getGuildId() === guild.id;
2026-07-29 08:29:29 +00:00
if (tmp9) {
tmp9 = isGuildTextChannelType(channel.type);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp9;
2026-07-20 16:05:17 +00:00
}
}
tmp5 = GuildFeatures;
2026-07-20 16:05:17 +00:00
}
return false;
});
};