PronounDB: Fix on user profiles

This commit is contained in:
Nuckyz 2024-08-23 18:41:34 -03:00
parent 8afcb8e4dd
commit f0e6986835
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
3 changed files with 29 additions and 27 deletions

View file

@ -19,7 +19,6 @@
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { UserStore } from "@webpack/common";
import virtualMerge from "virtual-merge";
export default definePlugin({
name: "NoProfileThemes",
@ -33,21 +32,7 @@ export default definePlugin({
replace: "$&$self.isCurrentUser(this.userId)&&"
}
},
{
find: "UserProfileStore",
replacement: {
match: /(?<=getUserProfile\(\i\){return )(.+?)(?=})/,
replace: "$self.removeProfileThemes($1)"
}
}
],
isCurrentUser: (userId: string) => userId === UserStore.getCurrentUser()?.id,
removeProfileThemes: (displayProfile: any) => {
if (displayProfile == null) return displayProfile;
return displayProfile.userId === UserStore.getCurrentUser()?.id
? displayProfile
: virtualMerge(displayProfile, { banner: undefined, profileEffectId: undefined });
}
});