Plugin
AlwaysExpandRoles
Always expands the role list in profile popouts
1
import { migratePluginSettings } from "@api/Settings";2
import { Devs } from "@utils/constants";3
import definePlugin from "@utils/types";4
5
migratePluginSettings("AlwaysExpandRoles", "ShowAllRoles");6
export default definePlugin({7
name: "AlwaysExpandRoles",8
description: "Always expands the role list in profile popouts",9
tags: ["Appearance", "Roles"],10
authors: [Devs.surgedevs],11
patches: [12
{13
find: "hasDeveloperContextMenu:",14
replacement: [15
{16
match: /(?<=\?\i\.current\[\i\].{0,100}?)useState\(!1\)/,17
replace: "useState(!0)"18
},19
{20
// Fix not calculating non-expanded roles because the above patch makes the default "expanded",21
// which makes the collapse button never show up and calculation never occur22
match: /(?<=useLayoutEffect\(\(\)=>\{if\()\i/,23
replace: "false"24
}25
]26
}27
]28
});29