BadgeAPI: fix our badges not showing if there are 0 discord badges
This commit is contained in:
parent
50c4513737
commit
4bf28f4634
1 changed files with 2 additions and 6 deletions
|
@ -93,17 +93,13 @@ export default definePlugin({
|
|||
{
|
||||
find: ".PANEL]:14",
|
||||
replacement: {
|
||||
match: /(?<=\i=\(0,\i\.default\)\(\i\);)return 0===\i.length/,
|
||||
replace: "$& && $self.getBadges(arguments[0]?.displayProfile).length===0"
|
||||
match: /(?<=(\i)=\(0,\i\.default\)\(\i\);)return 0===\i.length\?/,
|
||||
replace: "$1.unshift(...$self.getBadges(arguments[0].displayProfile));$&"
|
||||
}
|
||||
},
|
||||
{
|
||||
find: ".description,delay:",
|
||||
replacement: [
|
||||
{
|
||||
match: /...(\i)\}=\(0,\i\.useUserProfileAnalyticsContext\)\(\);/,
|
||||
replace: "$&arguments[0].badges?.unshift(...$self.getBadges($1));"
|
||||
},
|
||||
{
|
||||
// alt: "", aria-hidden: false, src: originalSrc
|
||||
match: /alt:" ","aria-hidden":!0,src:(?=.{0,20}(\i)\.icon)/,
|
||||
|
|
Loading…
Reference in a new issue