fix(ShowHiddenThings): always render highest role in ModView (#2709)

This commit is contained in:
Sqaaakoi 2024-07-31 09:18:42 +12:00 committed by GitHub
parent 5c88284ed3
commit 0f5cf37ef9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,6 +66,15 @@ export default definePlugin({
replace: "return true", replace: "return true",
} }
}, },
// fixes a bug where Members page must be loaded to see highest role, why is Discord depending on MemberSafetyStore.getEnhancedMember for something that can be obtained here?
{
find: "Messages.GUILD_MEMBER_MOD_VIEW_PERMISSION_GRANTED_BY_ARIA_LABEL,tooltipContentClassName",
predicate: () => settings.store.showModView,
replacement: {
match: /(role:)\i(?=,guildId.{0,100}role:(\i\[))/,
replace: "$1$2arguments[0].member.highestRoleId]",
}
},
{ {
find: "prod_discoverable_guilds", find: "prod_discoverable_guilds",
predicate: () => settings.store.disableDiscoveryFilters, predicate: () => settings.store.disableDiscoveryFilters,