diff --git a/src/plugins/alwaysExpandRoles/index.ts b/src/plugins/alwaysExpandRoles/index.ts index c674f90c5..2fff8a8de 100644 --- a/src/plugins/alwaysExpandRoles/index.ts +++ b/src/plugins/alwaysExpandRoles/index.ts @@ -27,17 +27,17 @@ export default definePlugin({ authors: [Devs.surgedevs], patches: [ { - find: 'action:"EXPAND_ROLES"', + find: "hasDeveloperContextMenu:", replacement: [ { - match: /(roles:\i(?=.+?(\i)\(!0\)[,;]\i\({action:"EXPAND_ROLES"}\)).+?\[\i,\2\]=\i\.useState\()!1\)/, - replace: (_, rest, setExpandedRoles) => `${rest}!0)` + match: /(?<=\?\i\.current\[\i\].{0,100}?)useState\(!1\)/, + replace: "useState(!0)" }, { // Fix not calculating non-expanded roles because the above patch makes the default "expanded", // which makes the collapse button never show up and calculation never occur - match: /(?<=useLayoutEffect\(\(\)=>{if\()\i/, - replace: isExpanded => "false" + match: /(?<=useLayoutEffect\(\(\)=>\{if\()\i/, + replace: "false" } ] } diff --git a/src/plugins/permissionsViewer/components/UserPermissions.tsx b/src/plugins/permissionsViewer/components/UserPermissions.tsx index 1219d2fc7..7e0572e59 100644 --- a/src/plugins/permissionsViewer/components/UserPermissions.tsx +++ b/src/plugins/permissionsViewer/components/UserPermissions.tsx @@ -37,14 +37,13 @@ interface UserPermission { type UserPermissions = Array; -const { RoleRootClasses, RoleClasses, RoleBorderClasses } = proxyLazyWebpack(() => { - const [RoleRootClasses, RoleClasses, RoleBorderClasses] = findBulk( - filters.byProps("root", "expandButton", "collapseButton"), +const { RoleClasses, RoleBorderClasses } = proxyLazyWebpack(() => { + const [RoleClasses, RoleBorderClasses] = findBulk( filters.byProps("role", "roleCircle", "roleName"), filters.byProps("roleCircle", "dot", "dotBorderColor") ) as Record[]; - return { RoleRootClasses, RoleClasses, RoleBorderClasses }; + return { RoleClasses, RoleBorderClasses }; }); interface FakeRoleProps extends React.HTMLAttributes { @@ -190,7 +189,7 @@ function UserPermissionsComponent({ guild, guildMember, closePopout }: { guild: {userPermissions.length > 0 && ( -
+
{userPermissions.map(({ permission, roleColor, roleName }) => ( { + ViewPermissionsButton: ErrorBoundary.wrap(({ className, guild, userId }: { className: string; guild: Guild; userId: string; }) => { + const guildMember = GuildMemberStore.getMember(guild.id, userId); + if (!guildMember) return null; + const buttonRef = useRef(null); return ( diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx index 796a81155..41978d8e6 100644 --- a/src/plugins/showConnections/index.tsx +++ b/src/plugins/showConnections/index.tsx @@ -160,10 +160,10 @@ export default definePlugin({ patches: [ { - find: ".hasAvatarForGuild(null==", + find: "UserProfilePopoutBody", replacement: { - match: /currentUser:\i,guild:\i[^}]*?\}\)(?=])(?<=user:(\i),bio:null==(\i)\?.+?)/, - replace: "$&,$self.profilePopoutComponent({ user: $1, displayProfile: $2 })" + match: /userId:\i\.id,guild:\i\}\)(?=])/, + replace: "$&,$self.profilePopoutComponent(arguments[0])" } } ], diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 03f5dd6be..c5e34618c 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -625,6 +625,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "u32", id: 1063237286818488351n, }, + prism: { + name: "prism", + id: 390884143749136386n, + }, } satisfies Record); // iife so #__PURE__ works correctly