Fix ViewIcons and NoProfileThemes

This commit is contained in:
Nuckyz 2024-08-23 03:02:04 -03:00
parent 2e81b9aeba
commit ed9b28febf
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
5 changed files with 29 additions and 34 deletions

View file

@ -57,14 +57,7 @@ export default definePlugin({
settings,
patches: [
{
find: ".NITRO_BANNER,",
replacement: {
match: /\?\(0,\i\.jsx\)\(\i,{type:\i,shown/,
replace: "&&$self.shouldShowBadge(arguments[0])$&"
}
},
{
find: ".banner)==null",
find: '.banner)==null?"COMPLETE"',
replacement: {
match: /(?<=void 0:)\i.getPreviewBanner\(\i,\i,\i\)/,
replace: "$self.patchBannerUrl(arguments[0])||$&"
@ -109,10 +102,6 @@ export default definePlugin({
if (this.userHasBackground(displayProfile?.userId)) return this.getImageUrl(displayProfile?.userId);
},
shouldShowBadge({ displayProfile, user }: any) {
return displayProfile?.banner && (!this.userHasBackground(user.id) || settings.store.nitroFirst);
},
userHasBackground(userId: string) {
return !!this.data?.users[userId];
},