From bc6abcbda68ec645f12b498fa2ae4cc5cc321ad8 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 1 Aug 2026 23:12:19 -0400 Subject: [PATCH] NewGuildSettings: Allow applying on folder with 250ms sleep --- src/plugins/newGuildSettings/index.tsx | 51 +++++++++++++++++++------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/src/plugins/newGuildSettings/index.tsx b/src/plugins/newGuildSettings/index.tsx index cbbba3d18..a7ce8697b 100644 --- a/src/plugins/newGuildSettings/index.tsx +++ b/src/plugins/newGuildSettings/index.tsx @@ -23,10 +23,11 @@ import { import { definePluginSettings } from "@api/Settings"; import { CogWheel } from "@components/Icons"; import { Devs } from "@utils/constants"; +import { sleep } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; import { Guild } from "@vencord/discord-types"; -import { findByCodeLazy, findByPropsLazy, findStoreLazy, mapMangledModuleLazy } from "@webpack"; -import { ChannelStore, Menu, UserStore } from "@webpack/common"; +import { findByCodeLazy, findByPropsLazy, mapMangledModuleLazy } from "@webpack"; +import { ChannelStore, CollapsedVoiceChannelStore, Menu, SortedGuildStore, UserStore } from "@webpack/common"; const { updateGuildNotificationSettings } = findByPropsLazy("updateGuildNotificationSettings"); const { toggleShowAllChannels } = mapMangledModuleLazy(".onboardExistingMember(", { @@ -36,7 +37,6 @@ const { toggleShowAllChannels } = mapMangledModuleLazy(".onboardExistingMember(" } }); const isOptInEnabledForGuild = findByCodeLazy(".COMMUNITY)||", ".isOptInEnabled("); -const CollapsedVoiceChannelStore = findStoreLazy("CollapsedVoiceChannelStore"); const collapsedChannels = findByPropsLazy("toggleCollapseGuild"); const settings = definePluginSettings({ @@ -92,18 +92,41 @@ const settings = definePluginSettings({ } }); -const makeContextMenuPatch: (shouldAddIcon: boolean) => NavContextMenuPatchCallback = (shouldAddIcon: boolean) => (children, { guild }: { guild: Guild, onClose(): void; }) => { - if (!guild) return; +const makeContextMenuPatch: (shouldAddIcon: boolean) => NavContextMenuPatchCallback = (shouldAddIcon: boolean) => (children, props: { guild?: Guild; folderId?: number; onClose(): void; }) => { + const { guild, folderId } = props; - const group = findGroupChildrenByChildId("privacy", children); - group?.push( -