From a2f0c912f0f3c18e19ce2f3f62414421b3fe73cb Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Tue, 21 Mar 2023 06:41:31 -0300 Subject: [PATCH] Fix Fake Nitro making Discord unusable and ColorSighted not working sometimes (#640) --- src/plugins/colorSighted.ts | 9 +++++++-- src/plugins/fakeNitro.ts | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/colorSighted.ts b/src/plugins/colorSighted.ts index 659e341d..d2fb0d65 100644 --- a/src/plugins/colorSighted.ts +++ b/src/plugins/colorSighted.ts @@ -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"` + } } ] }); diff --git a/src/plugins/fakeNitro.ts b/src/plugins/fakeNitro.ts index 7e583d70..df8ac770 100644 --- a/src/plugins/fakeNitro.ts +++ b/src/plugins/fakeNitro.ts @@ -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;