This commit is contained in:
Mirco Wittrien 2022-09-27 21:28:54 +02:00
parent 90b6e7e4d2
commit a46fefafcb
9 changed files with 28 additions and 28 deletions

View File

@ -3282,7 +3282,7 @@ module.exports = (_ => {
return Internal.LibraryModules.IconUtils.getGuildBannerURL(guild).split("?")[0]; return Internal.LibraryModules.IconUtils.getGuildBannerURL(guild).split("?")[0];
}; };
BDFDB.GuildUtils.getFolder = function (id) { BDFDB.GuildUtils.getFolder = function (id) {
return Internal.LibraryStores.SortedGuildStore.guildFolders.filter(n => n.folderId).find(n => n.guildIds.includes(id)); return Internal.LibraryModules.SortedGuildUtils.guildFolders.filter(n => n.folderId).find(n => n.guildIds.includes(id));
}; };
BDFDB.GuildUtils.openMenu = function (guild, e = mousePosition) { BDFDB.GuildUtils.openMenu = function (guild, e = mousePosition) {
if (!guild) return; if (!guild) return;
@ -3318,7 +3318,7 @@ module.exports = (_ => {
return BDFDB.ReactUtils.findValue(div, "folderId", {up: true}); return BDFDB.ReactUtils.findValue(div, "folderId", {up: true});
}; };
BDFDB.FolderUtils.getDefaultName = function (folderId) { BDFDB.FolderUtils.getDefaultName = function (folderId) {
let folder = Internal.LibraryStores.SortedGuildStore.getGuildFolderById(folderId); let folder = Internal.LibraryModules.SortedGuildUtils.getGuildFolderById(folderId);
if (!folder) return ""; if (!folder) return "";
let rest = 2 * Internal.DiscordConstants.MAX_GUILD_FOLDER_NAME_LENGTH; let rest = 2 * Internal.DiscordConstants.MAX_GUILD_FOLDER_NAME_LENGTH;
let names = [], allNames = folder.guildIds.map(guildId => (Internal.LibraryStores.GuildStore.getGuild(guildId) || {}).name).filter(n => n); let names = [], allNames = folder.guildIds.map(guildId => (Internal.LibraryStores.GuildStore.getGuild(guildId) || {}).name).filter(n => n);
@ -7101,7 +7101,7 @@ module.exports = (_ => {
return BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Flex, { return BDFDB.ReactUtils.createElement(Internal.LibraryComponents.Flex, {
className: this.props.className, className: this.props.className,
wrap: Internal.LibraryComponents.Flex.Wrap.WRAP, wrap: Internal.LibraryComponents.Flex.Wrap.WRAP,
children: [this.props.includeDMs && {name: BDFDB.LanguageUtils.LanguageStrings.DIRECT_MESSAGES, acronym: "DMs", id: Internal.DiscordConstants.ME, getIconURL: _ => {}}].concat(Internal.LibraryStores.SortedGuildStore.getFlattenedGuilds()).filter(n => n).map(guild => BDFDB.ReactUtils.createElement(Internal.LibraryComponents.TooltipContainer, { children: [this.props.includeDMs && {name: BDFDB.LanguageUtils.LanguageStrings.DIRECT_MESSAGES, acronym: "DMs", id: Internal.DiscordConstants.ME, getIconURL: _ => {}}].concat(Internal.LibraryModules.SortedGuildUtils.getFlattenedGuilds()).filter(n => n).map(guild => BDFDB.ReactUtils.createElement(Internal.LibraryComponents.TooltipContainer, {
text: guild.name, text: guild.name,
children: BDFDB.ReactUtils.createElement("div", { children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.DOMUtils.formatClassName(this.props.guildClassName, BDFDB.disCN.settingsguild, this.props.disabled.includes(guild.id) && BDFDB.disCN.settingsguilddisabled), className: BDFDB.DOMUtils.formatClassName(this.props.guildClassName, BDFDB.disCN.settingsguild, this.props.disabled.includes(guild.id) && BDFDB.disCN.settingsguilddisabled),

View File

@ -137,7 +137,7 @@ module.exports = (_ => {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.QuerySearchUtils, "queryChannels", {after: e => { BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.QuerySearchUtils, "queryChannels", {after: e => {
if (!e.methodArguments[0].query) return; if (!e.methodArguments[0].query) return;
for (let id of BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(id => Object.keys(BDFDB.LibraryStores.ChannelStore.getMutableGuildChannelsForGuild(id))).flat()) { for (let id of BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuildIds().map(id => Object.keys(BDFDB.LibraryStores.ChannelStore.getMutableGuildChannelsForGuild(id))).flat()) {
let channel = BDFDB.LibraryStores.ChannelStore.getChannel(id); let channel = BDFDB.LibraryStores.ChannelStore.getChannel(id);
if (channel && !channel.isCategory()) { if (channel && !channel.isCategory()) {
let category = channel.parent_id && BDFDB.LibraryStores.ChannelStore.getChannel(channel.parent_id); let category = channel.parent_id && BDFDB.LibraryStores.ChannelStore.getChannel(channel.parent_id);

View File

@ -271,7 +271,7 @@ module.exports = (_ => {
} }
getGuildFromRoleId (roleId) { getGuildFromRoleId (roleId) {
return BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuilds().find(g => g.roles[roleId]); return BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuilds().find(g => g.roles[roleId]);
} }
changeRolesInGuild (guild, useNative) { changeRolesInGuild (guild, useNative) {
@ -300,7 +300,7 @@ module.exports = (_ => {
BDFDB.DataUtils.remove(this, "roles", id); BDFDB.DataUtils.remove(this, "roles", id);
} }
else { else {
for (let guild of BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuilds()) if (cachedRoles[guild.id]) guild.roles = cachedRoles[guild.id]; for (let guild of BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuilds()) if (cachedRoles[guild.id]) guild.roles = cachedRoles[guild.id];
cachedRoles = {}; cachedRoles = {};
BDFDB.DataUtils.remove(this, "roles"); BDFDB.DataUtils.remove(this, "roles");
} }

View File

@ -161,7 +161,7 @@ module.exports = (_ => {
else return item[data.key]; else return item[data.key];
} }
})), })),
data: BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuilds().map((guild, i) => { data: BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuilds().map((guild, i) => {
let itemData = { let itemData = {
index: i, index: i,
guild: guild, guild: guild,

View File

@ -761,7 +761,7 @@ module.exports = (_ => {
} }
getStatusWithMobileAndActivity (id, config, clientStatuses) { getStatusWithMobileAndActivity (id, config, clientStatuses) {
let voiceState = BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().map(BDFDB.LibraryStores.SortedVoiceStateStore.getVoiceStates).map(BDFDB.ObjectUtils.toArray).flat(10).find(n => n.selfStream & n.userId == id && BDFDB.LibraryStores.ChannelStore.getChannel(n.channelId) && BDFDB.UserUtils.can("VIEW_CHANNEL", BDFDB.UserUtils.me.id, n.channelId)); let voiceState = BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuildIds().map(BDFDB.LibraryStores.SortedVoiceStateStore.getVoiceStates).map(BDFDB.ObjectUtils.toArray).flat(10).find(n => n.selfStream & n.userId == id && BDFDB.LibraryStores.ChannelStore.getChannel(n.channelId) && BDFDB.UserUtils.can("VIEW_CHANNEL", BDFDB.UserUtils.me.id, n.channelId));
let status = { let status = {
name: BDFDB.UserUtils.getStatus(id), name: BDFDB.UserUtils.getStatus(id),
activity: null, activity: null,

View File

@ -69,7 +69,7 @@ module.exports = (_ => {
BDFDB.GuildUtils.markAsRead(guildIds.filter(id => id && !blacklist.includes(id))); BDFDB.GuildUtils.markAsRead(guildIds.filter(id => id && !blacklist.includes(id)));
} }
getGuilds() { getGuilds() {
return BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuilds().map(g => g.id).filter(n => n); return BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuilds().map(g => g.id).filter(n => n);
} }
getUnread() { getUnread() {
return this.getGuilds().filter(id => BDFDB.LibraryStores.GuildReadStateStore.hasUnread(id) || BDFDB.LibraryStores.GuildReadStateStore.getMentionCount(id) > 0); return this.getGuilds().filter(id => BDFDB.LibraryStores.GuildReadStateStore.hasUnread(id) || BDFDB.LibraryStores.GuildReadStateStore.getMentionCount(id) > 0);
@ -314,7 +314,7 @@ module.exports = (_ => {
batchSetGuilds (settingsPanel, collapseStates, value) { batchSetGuilds (settingsPanel, collapseStates, value) {
if (!value) { if (!value) {
for (let id of BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds()) blacklist.push(id); for (let id of BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuildIds()) blacklist.push(id);
this.saveBlacklist(BDFDB.ArrayUtils.removeCopies(blacklist)); this.saveBlacklist(BDFDB.ArrayUtils.removeCopies(blacklist));
} }
else this.saveBlacklist([]); else this.saveBlacklist([]);

View File

@ -79,7 +79,7 @@ module.exports = (_ => {
className: BDFDB.disCNS.guildouter + BDFDB.disCN._servercounterservercountwrap, className: BDFDB.disCNS.guildouter + BDFDB.disCN._servercounterservercountwrap,
children: BDFDB.ReactUtils.createElement("div", { children: BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.guildslabel + BDFDB.disCN._servercounterservercount, className: BDFDB.disCNS.guildslabel + BDFDB.disCN._servercounterservercount,
children: `${BDFDB.LanguageUtils.LanguageStrings.SERVERS}  ${BDFDB.LibraryStores.SortedGuildStore.getFlattenedGuildIds().length}` children: `${BDFDB.LanguageUtils.LanguageStrings.SERVERS}  ${BDFDB.LibraryModules.SortedGuildUtils.getFlattenedGuildIds().length}`
}) })
})); }));
} }

View File

@ -85,7 +85,7 @@ module.exports = (_ => {
render() { render() {
let closing = this.props.closing; let closing = this.props.closing;
delete this.props.closing; delete this.props.closing;
let folders = Array.from(BDFDB.LibraryStores.ExpandedGuildFolderStore.getExpandedFolders()).map(folderId => BDFDB.LibraryStores.SortedGuildStore.getGuildFolderById(folderId)).filter(folder => folder && folder.guildIds); let folders = Array.from(BDFDB.LibraryStores.ExpandedGuildFolderStore.getExpandedFolders()).map(folderId => BDFDB.LibraryModules.SortedGuildUtils.getGuildFolderById(folderId)).filter(folder => folder && folder.guildIds);
this.props.folders = folders.length || closing ? folders : (this.props.folders || []); this.props.folders = folders.length || closing ? folders : (this.props.folders || []);
BDFDB.TimeUtils.clear(this._rerenderTimeout); BDFDB.TimeUtils.clear(this._rerenderTimeout);
if (!folders.length && this.props.folders.length && !closing) this._rerenderTimeout = BDFDB.TimeUtils.timeout(_ => { if (!folders.length && this.props.folders.length && !closing) this._rerenderTimeout = BDFDB.TimeUtils.timeout(_ => {
@ -576,9 +576,9 @@ module.exports = (_ => {
onGuildContextMenu (e) { onGuildContextMenu (e) {
if (document.querySelector(BDFDB.dotCN.modalwrapper)) return; if (document.querySelector(BDFDB.dotCN.modalwrapper)) return;
if (e.instance.props.guild) { if (e.instance.props.guild) {
let folders = BDFDB.LibraryStores.SortedGuildStore.guildFolders.filter(n => n.folderId); let folders = BDFDB.LibraryModules.SortedGuildUtils.guildFolders.filter(n => n.folderId);
let folder = BDFDB.GuildUtils.getFolder(e.instance.props.guild.id); let folder = BDFDB.GuildUtils.getFolder(e.instance.props.guild.id);
let unfolderedGuilds = BDFDB.LibraryStores.SortedGuildStore.getSortedGuilds().filter(n => !n.folderId).map(n => n.guilds[0]).filter(n => n); let unfolderedGuilds = BDFDB.LibraryModules.SortedGuildUtils.getSortedGuilds().filter(n => !n.folderId).map(n => n.guilds[0]).filter(n => n);
let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true}); let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true});
children.splice(index > -1 ? index : children.length, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, { children.splice(index > -1 ? index : children.length, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
@ -617,7 +617,7 @@ module.exports = (_ => {
onGuildFolderContextMenu (e) { onGuildFolderContextMenu (e) {
if (document.querySelector(BDFDB.dotCN.modalwrapper)) return; if (document.querySelector(BDFDB.dotCN.modalwrapper)) return;
if (e.instance.props.target && e.instance.props.folderId) { if (e.instance.props.target && e.instance.props.folderId) {
let folder = BDFDB.LibraryStores.SortedGuildStore.getGuildFolderById(e.instance.props.folderId); let folder = BDFDB.LibraryModules.SortedGuildUtils.getGuildFolderById(e.instance.props.folderId);
let data = this.getFolderConfig(e.instance.props.folderId); let data = this.getFolderConfig(e.instance.props.folderId);
let muted = data.muteFolder && folder.guildIds.every(guildid => BDFDB.LibraryStores.UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(guildid)); let muted = data.muteFolder && folder.guildIds.every(guildid => BDFDB.LibraryStores.UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(guildid));
if (data.muteFolder != muted) { if (data.muteFolder != muted) {
@ -683,7 +683,7 @@ module.exports = (_ => {
if (topBar) { if (topBar) {
let topIsVisible = topBar.props.isVisible; let topIsVisible = topBar.props.isVisible;
topBar.props.isVisible = BDFDB.TimeUtils.suppress((...args) => { topBar.props.isVisible = BDFDB.TimeUtils.suppress((...args) => {
let ids = BDFDB.LibraryStores.SortedGuildStore.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10); let ids = BDFDB.LibraryModules.SortedGuildUtils.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10);
args[2] = args[2].filter(id => !ids.includes(id)); args[2] = args[2].filter(id => !ids.includes(id));
return topIsVisible(...args) || BDFDB.LibraryStores.GuildReadStateStore.getMentionCount(args[0]) == 0; return topIsVisible(...args) || BDFDB.LibraryStores.GuildReadStateStore.getMentionCount(args[0]) == 0;
}, "Error in isVisible of Top Bar in Guild List!"); }, "Error in isVisible of Top Bar in Guild List!");
@ -692,7 +692,7 @@ module.exports = (_ => {
if (bottomBar) { if (bottomBar) {
let bottomIsVisible = bottomBar.props.isVisible; let bottomIsVisible = bottomBar.props.isVisible;
bottomBar.props.isVisible = BDFDB.TimeUtils.suppress((...args) => { bottomBar.props.isVisible = BDFDB.TimeUtils.suppress((...args) => {
let ids = BDFDB.LibraryStores.SortedGuildStore.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10); let ids = BDFDB.LibraryModules.SortedGuildUtils.guildFolders.filter(n => n.folderId).map(n => n.guildIds).flat(10);
args[2] = args[2].filter(id => !ids.includes(id)); args[2] = args[2].filter(id => !ids.includes(id));
return bottomIsVisible(...args) || BDFDB.LibraryStores.GuildReadStateStore.getMentionCount(args[0]) == 0; return bottomIsVisible(...args) || BDFDB.LibraryStores.GuildReadStateStore.getMentionCount(args[0]) == 0;
}, "Error in isVisible of Bottom Bar in Guild List!"); }, "Error in isVisible of Bottom Bar in Guild List!");
@ -813,7 +813,7 @@ module.exports = (_ => {
BDFDB.DOMUtils.removeClass(root, BDFDB.disCN.modalsmall); BDFDB.DOMUtils.removeClass(root, BDFDB.disCN.modalsmall);
} }
if (e.returnvalue) { if (e.returnvalue) {
let folder = BDFDB.LibraryStores.SortedGuildStore.getGuildFolderById(e.instance.props.folderId); let folder = BDFDB.LibraryModules.SortedGuildUtils.getGuildFolderById(e.instance.props.folderId);
let data = this.getFolderConfig(e.instance.props.folderId); let data = this.getFolderConfig(e.instance.props.folderId);
let newData = Object.assign({}, data, {folderName: folder.folderName}); let newData = Object.assign({}, data, {folderName: folder.folderName});
@ -990,7 +990,7 @@ module.exports = (_ => {
generateId (prefix) { generateId (prefix) {
if (prefix == "folder") { if (prefix == "folder") {
let id = Math.floor(Math.random() * 4294967296); let id = Math.floor(Math.random() * 4294967296);
return BDFDB.LibraryStores.SortedGuildStore.guildFolders.every(n => !n.folderId || n.folderId != id) ? id : this.generateId(prefix); return BDFDB.LibraryModules.SortedGuildUtils.guildFolders.every(n => !n.folderId || n.folderId != id) ? id : this.generateId(prefix);
} }
else { else {
let data = BDFDB.DataUtils.load(this, prefix + "s"); let data = BDFDB.DataUtils.load(this, prefix + "s");
@ -1010,7 +1010,7 @@ module.exports = (_ => {
} }
getFolderConfig (folderId) { getFolderConfig (folderId) {
let folder = BDFDB.LibraryStores.SortedGuildStore.getGuildFolderById(folderId) || {}; let folder = BDFDB.LibraryModules.SortedGuildUtils.getGuildFolderById(folderId) || {};
let data = folderConfigs[folderId] || { let data = folderConfigs[folderId] || {
iconID: "-1", iconID: "-1",
muteFolder: false, muteFolder: false,
@ -1099,7 +1099,7 @@ module.exports = (_ => {
} }
updateFolder (folder) { updateFolder (folder) {
let oldGuildFolders = [].concat(BDFDB.LibraryStores.SortedGuildStore.guildFolders), guildFolders = [], guildPositions = []; let oldGuildFolders = [].concat(BDFDB.LibraryModules.SortedGuildUtils.guildFolders), guildFolders = [], guildPositions = [];
for (let oldFolder of oldGuildFolders) { for (let oldFolder of oldGuildFolders) {
if (oldFolder.folderId == folder.folderId) guildFolders.push(Object.assign({}, oldFolder, folder)); if (oldFolder.folderId == folder.folderId) guildFolders.push(Object.assign({}, oldFolder, folder));
else guildFolders.push(oldFolder); else guildFolders.push(oldFolder);
@ -1112,7 +1112,7 @@ module.exports = (_ => {
if (!guildIds) return; if (!guildIds) return;
guildIds = [guildIds].flat(10); guildIds = [guildIds].flat(10);
if (!guildIds.length) return; if (!guildIds.length) return;
let oldGuildFolders = [].concat(BDFDB.LibraryStores.SortedGuildStore.guildFolders), guildFolders = [], guildPositions = [], added = false; let oldGuildFolders = [].concat(BDFDB.LibraryModules.SortedGuildUtils.guildFolders), guildFolders = [], guildPositions = [], added = false;
for (let oldFolder of oldGuildFolders) { for (let oldFolder of oldGuildFolders) {
if (!oldFolder.folderId && guildIds.includes(oldFolder.guildIds[0])) { if (!oldFolder.folderId && guildIds.includes(oldFolder.guildIds[0])) {
if (!added) { if (!added) {
@ -1130,7 +1130,7 @@ module.exports = (_ => {
} }
removeFolder (folderId) { removeFolder (folderId) {
let oldGuildFolders = [].concat(BDFDB.LibraryStores.SortedGuildStore.guildFolders), guildFolders = [], guildPositions = []; let oldGuildFolders = [].concat(BDFDB.LibraryModules.SortedGuildUtils.guildFolders), guildFolders = [], guildPositions = [];
for (let oldFolder of oldGuildFolders) { for (let oldFolder of oldGuildFolders) {
if (oldFolder.folderId == folderId) { if (oldFolder.folderId == folderId) {
for (let guildId of oldFolder.guildIds) guildFolders.push({guildIds: [guildId]}); for (let guildId of oldFolder.guildIds) guildFolders.push({guildIds: [guildId]});
@ -1142,7 +1142,7 @@ module.exports = (_ => {
} }
addGuildToFolder (folderId, guildId) { addGuildToFolder (folderId, guildId) {
let oldGuildFolders = [].concat(BDFDB.LibraryStores.SortedGuildStore.guildFolders), guildFolders = [], guildPositions = []; let oldGuildFolders = [].concat(BDFDB.LibraryModules.SortedGuildUtils.guildFolders), guildFolders = [], guildPositions = [];
for (let oldFolder of oldGuildFolders) { for (let oldFolder of oldGuildFolders) {
if (oldFolder.folderId) { if (oldFolder.folderId) {
let newFolder = Object.assign({}, oldFolder); let newFolder = Object.assign({}, oldFolder);
@ -1157,7 +1157,7 @@ module.exports = (_ => {
} }
removeGuildFromFolder (folderId, guildId) { removeGuildFromFolder (folderId, guildId) {
let oldGuildFolders = [].concat(BDFDB.LibraryStores.SortedGuildStore.guildFolders), guildFolders = [], guildPositions = []; let oldGuildFolders = [].concat(BDFDB.LibraryModules.SortedGuildUtils.guildFolders), guildFolders = [], guildPositions = [];
for (let oldFolder of oldGuildFolders) { for (let oldFolder of oldGuildFolders) {
if (oldFolder.folderId == folderId) { if (oldFolder.folderId == folderId) {
let newFolder = Object.assign({}, oldFolder); let newFolder = Object.assign({}, oldFolder);

View File

@ -80,7 +80,7 @@ module.exports = (_ => {
if (e.methodArguments[0].type == "STREAMER_MODE_UPDATE") BDFDB.GuildUtils.rerenderAll(true); if (e.methodArguments[0].type == "STREAMER_MODE_UPDATE") BDFDB.GuildUtils.rerenderAll(true);
}}); }});
BDFDB.PatchUtils.patch(this, BDFDB.LibraryStores.SortedGuildStore, "getGuildFolderById", {after: e => { BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.SortedGuildUtils, "getGuildFolderById", {after: e => {
let hiddenGuildIds = hiddenEles.servers || []; let hiddenGuildIds = hiddenEles.servers || [];
if (e.returnValue && hiddenGuildIds.length) { if (e.returnValue && hiddenGuildIds.length) {
let folder = Object.assign({}, e.returnValue); let folder = Object.assign({}, e.returnValue);
@ -220,8 +220,8 @@ module.exports = (_ => {
let hiddenGuildIds = hiddenEles && hiddenEles.servers || []; let hiddenGuildIds = hiddenEles && hiddenEles.servers || [];
let hiddenFolderIds = hiddenEles && hiddenEles.folders || []; let hiddenFolderIds = hiddenEles && hiddenEles.folders || [];
let guilds = BDFDB.LibraryStores.SortedGuildStore.guildFolders.map(n => n.guildIds).flat(10).map(guildId => BDFDB.LibraryStores.GuildStore.getGuild(guildId)).filter(n => n); let guilds = BDFDB.LibraryModules.SortedGuildUtils.guildFolders.map(n => n.guildIds).flat(10).map(guildId => BDFDB.LibraryStores.GuildStore.getGuild(guildId)).filter(n => n);
let folders = BDFDB.LibraryStores.SortedGuildStore.guildFolders.filter(n => n.folderId); let folders = BDFDB.LibraryModules.SortedGuildUtils.guildFolders.filter(n => n.folderId);
let foldersAdded = []; let foldersAdded = [];
BDFDB.ModalUtils.open(this, { BDFDB.ModalUtils.open(this, {