decord/source/modules/guild_sidebar/SectionFooterHelpers.tsx

120 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15566
// Function ID: 15567
2026-07-29 08:29:29 +00:00
// Name: getSectionFooterConfig
2026-08-24 06:08:38 +00:00
// Dependencies: [5275, 4024, 5286, 676, 5277, 1913, 2]
2026-07-29 08:29:29 +00:00
// Exports: getSectionFooterActiveVoiceChannels, getSectionFooterConfig, isSectionFooterWithActiveVoiceChannels
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 15566 (getSectionFooterConfig)
import computeSubtitle from "computeSubtitle" /* 5277 */;
import closure_2 from "incrementVersion" /* 5275 */;
import closure_3 from "getUncachedChannelPermissions" /* 4024 */;
import { ChannelListGuildActionRow } from "ChannelListGuildActionRow" /* 5286 */;
import { Permissions } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("modules/guild_sidebar/SectionFooterHelpers.tsx");
2026-07-29 08:29:29 +00:00
export const getSectionFooterConfig = function getSectionFooterConfig(guildChannels, optInChannelsEnabled, section) {
2026-08-24 06:08:38 +00:00
if (section === computeSubtitle.SECTION_INDEX_GUILD_ACTIONS) {
2026-07-29 08:29:29 +00:00
const guildActionSection = guildChannels.getGuildActionSection();
2026-07-20 16:05:17 +00:00
const rows = guildActionSection.getRows();
let isEmptyResult = 1 === rows.length;
if (isEmptyResult) {
isEmptyResult = rows[0] === ChannelListGuildActionRow.GUILD_PREMIUM_PROGRESS_BAR;
}
if (!isEmptyResult) {
2026-07-29 08:29:29 +00:00
const guildActionSection1 = guildChannels.getGuildActionSection();
2026-07-20 16:05:17 +00:00
isEmptyResult = guildActionSection1.isEmpty();
}
2026-07-29 08:29:29 +00:00
let tmp3 = isEmptyResult;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp3 = 0 === guildChannels.getSections(false)[section];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp6 = !tmp3;
if (!tmp3) {
2026-08-24 06:08:38 +00:00
const tmp7 = section === tmp(5277).SECTION_INDEX_GUILD_ACTIONS;
2026-07-20 16:05:17 +00:00
if (tmp7) {
2026-07-29 08:29:29 +00:00
tmp6 = tmp7;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (tmpResult.isFavoritesGuildId(guildChannels.id)) {
let tmp8 = section !== guildChannels.getSections(false).length - 1;
2026-07-25 08:10:48 +00:00
} else {
2026-08-24 06:08:38 +00:00
tmp8 = section === tmp(5277).SECTION_INDEX_FAVORITES;
2026-07-29 08:29:29 +00:00
if (!tmp8) {
let tmp10 = optInChannelsEnabled;
if (tmp10) {
2026-08-24 06:08:38 +00:00
let tmp11 = section !== tmp(5277).SECTION_INDEX_UNCATEGORIZED_CHANNELS;
2026-07-29 08:29:29 +00:00
if (tmp11) {
let flag2 = section === guildChannels.recentsSectionNumber;
2026-07-25 08:10:48 +00:00
if (!flag2) {
2026-07-29 08:29:29 +00:00
const voiceChannelsSectionNumber = guildChannels.voiceChannelsSectionNumber;
2026-07-25 08:10:48 +00:00
flag2 = false;
}
2026-07-29 08:29:29 +00:00
tmp11 = flag2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp10 = tmp11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp8 = tmp10;
2026-07-20 16:05:17 +00:00
}
}
2026-08-11 06:20:06 +00:00
tmpResult = tmp(1913);
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
const obj = { hasDivider: tmp6, canHaveVoiceSummary: !(section === computeSubtitle.SECTION_INDEX_GUILD_ACTIONS || section === computeSubtitle.SECTION_INDEX_FAVORITES || section === computeSubtitle.SECTION_INDEX_UNCATEGORIZED_CHANNELS || section === guildChannels.recentsSectionNumber || section === guildChannels.voiceChannelsSectionNumber) };
2026-07-29 08:29:29 +00:00
return obj;
};
export const getSectionFooterActiveVoiceChannels = function getSectionFooterActiveVoiceChannels(arg0) {
2026-08-24 06:08:38 +00:00
({ category, voiceStates: require, selectedChannelId: dependencyMap, selectedVoiceChannelId: closure_2 } = arg0);
if (true !== closure_2.isCollapsed(category.record.id)) {
2026-07-20 16:05:17 +00:00
let items = [];
} else {
const channelRecords = category.getChannelRecords();
items = channelRecords.filter((id) => {
2026-08-24 06:08:38 +00:00
if (closure_1_3.can(closure_1_5.VIEW_CHANNEL, id)) {
2026-07-23 10:11:24 +00:00
let items = table[id.id];
2026-07-29 08:29:29 +00:00
if (items == null) {
2026-07-20 16:05:17 +00:00
items = [];
}
2026-08-24 06:08:38 +00:00
let tmp4 = id.id !== closure_2;
2026-07-20 16:05:17 +00:00
if (tmp4) {
tmp4 = id.id !== closure_1;
}
if (tmp4) {
tmp4 = items.length > 0;
}
return tmp4;
} else {
return false;
}
});
}
return items;
};
2026-07-29 08:29:29 +00:00
export const isSectionFooterWithActiveVoiceChannels = function isSectionFooterWithActiveVoiceChannels(arg0) {
2026-08-24 06:08:38 +00:00
({ category, voiceStates: require, selectedChannelId: dependencyMap, selectedVoiceChannelId: closure_2 } = arg0);
if (true !== closure_2.isCollapsed(category.record.id)) {
2026-07-29 08:29:29 +00:00
let items = [];
} else {
const channelRecords = category.getChannelRecords();
items = channelRecords.filter((id) => {
2026-08-24 06:08:38 +00:00
if (closure_1_3.can(closure_1_5.VIEW_CHANNEL, id)) {
2026-07-29 08:29:29 +00:00
let items = table[id.id];
if (items == null) {
items = [];
}
2026-08-24 06:08:38 +00:00
let tmp4 = id.id !== closure_2;
2026-07-29 08:29:29 +00:00
if (tmp4) {
tmp4 = id.id !== closure_1;
}
if (tmp4) {
tmp4 = items.length > 0;
}
return tmp4;
} else {
return false;
}
});
}
return items.length > 0;
2026-07-20 16:05:17 +00:00
};