Fix Fake Nitro making Discord unusable and ColorSighted not working sometimes (#640)

This commit is contained in:
Nuckyz 2023-03-21 06:41:31 -03:00 committed by GitHub
parent e29bbf73aa
commit a2f0c912f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -27,11 +27,16 @@ export default definePlugin({
{
find: "Masks.STATUS_ONLINE",
replacement: {
// we can use global replacement here - these are specific to the status icons and are used nowhere else,
// so it keeps the patch and plugin small and simple
match: /Masks\.STATUS_(?:IDLE|DND|STREAMING|OFFLINE)/g,
replace: "Masks.STATUS_ONLINE"
}
},
{
find: ".AVATAR_STATUS_MOBILE_16;",
replacement: {
match: /(\.fromIsMobile,.+?)\i.status/,
replace: (_, rest) => `${rest}"online"`
}
}
]
});

View file

@ -211,7 +211,7 @@ export default definePlugin({
},
handleProtoChange(proto: any, user: any) {
const premiumType = user?.premium_type ?? UserStore.getCurrentUser().premiumType ?? 0;
const premiumType = user?.premium_type ?? UserStore.getCurrentUser()?.premiumType ?? 0;
if (premiumType === 0) {
const themeId = UserSettingsProtoStore.settings.appearance?.clientThemeSettings?.backgroundGradientPresetId?.value;