From 690574376bba7c5848b8ebf076be31d7ebf16037 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 9 May 2025 02:19:02 +0200 Subject: [PATCH 1/2] update to latest React Devtools --- src/main/utils/extensions.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/utils/extensions.ts b/src/main/utils/extensions.ts index 8a211baf7..1323bd37f 100644 --- a/src/main/utils/extensions.ts +++ b/src/main/utils/extensions.ts @@ -67,13 +67,7 @@ export async function installExt(id: string) { try { await access(extDir, fsConstants.F_OK); } catch (err) { - const url = id === "fmkadmapgofadopljbjfkapdkoienihi" - // React Devtools v4.25 - // v4.27 is broken in Electron, see https://github.com/facebook/react/issues/25843 - // Unfortunately, Google does not serve old versions, so this is the only way - // This zip file is pinned to long commit hash so it cannot be changed remotely - ? "https://raw.githubusercontent.com/Vendicated/random-files/f6f550e4c58ac5f2012095a130406c2ab25b984d/fmkadmapgofadopljbjfkapdkoienihi.zip" - : `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=${process.versions.chrome}`; + const url = `https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&x=id%3D${id}%26uc&prodversion=${process.versions.chrome}`; const buf = await get(url, { headers: { From 92ff9c1ca4dfb787178cdfdd1d4178ac113b9188 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Mon, 12 May 2025 20:38:58 -0300 Subject: [PATCH 2/2] Fix IrcColors for gradient roles and other patches --- src/plugins/consoleJanitor/index.tsx | 2 +- src/plugins/ircColors/index.ts | 14 ++++++++++++-- src/plugins/mutualGroupDMs/index.tsx | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/plugins/consoleJanitor/index.tsx b/src/plugins/consoleJanitor/index.tsx index d32f525e1..7ef7ec9c8 100644 --- a/src/plugins/consoleJanitor/index.tsx +++ b/src/plugins/consoleJanitor/index.tsx @@ -197,7 +197,7 @@ export default definePlugin({ }, // Patches Discord generic logger function { - find: "Σ:", + find: '"file-only"!==', predicate: () => settings.store.disableLoggers, replacement: { match: /(?<=&&)(?=console)/, diff --git a/src/plugins/ircColors/index.ts b/src/plugins/ircColors/index.ts index d4f453a78..d543c9950 100644 --- a/src/plugins/ircColors/index.ts +++ b/src/plugins/ircColors/index.ts @@ -66,8 +66,10 @@ export default definePlugin({ { find: '="SYSTEM_TAG"', replacement: { - match: /(?<=\.username.{0,50}?)style:/, - replace: "style:{color:$self.calculateNameColorForMessageContext(arguments[0])},_style:" + // Override colorString with our custom color and disable gradients if applying the custom color. + match: /&&null!=\i\.secondaryColor,(?<=colorString:(\i).+?(\i)=.+?)/, + replace: (m, colorString, hasGradientColors) => `${m}` + + `vcIrcColorsDummy=[${colorString},${hasGradientColors}]=$self.getMessageColorsVariables(arguments[0],${hasGradientColors}),` } }, { @@ -80,6 +82,13 @@ export default definePlugin({ } ], + getMessageColorsVariables(context: any, hasGradientColors: boolean) { + const colorString = this.calculateNameColorForMessageContext(context); + const originalColorString = context?.author?.colorString; + + return [colorString, hasGradientColors && colorString === originalColorString]; + }, + calculateNameColorForMessageContext(context: any) { const userId: string | undefined = context?.message?.author?.id; const colorString = context?.author?.colorString; @@ -97,6 +106,7 @@ export default definePlugin({ ? color : colorString; }, + calculateNameColorForListContext(context: any) { const id = context?.user?.id; const colorString = context?.colorString; diff --git a/src/plugins/mutualGroupDMs/index.tsx b/src/plugins/mutualGroupDMs/index.tsx index d88e1ee0b..e46824b44 100644 --- a/src/plugins/mutualGroupDMs/index.tsx +++ b/src/plugins/mutualGroupDMs/index.tsx @@ -126,8 +126,8 @@ export default definePlugin({ }, // Make the tab bar item text smaller so our tab can fit. { - match: /(\.tabBarItem.+?variant:)"heading-lg\/medium"/, - replace: '$1"heading-sm/medium"' + match: /(\.tabBarItem.+?variant:)"heading-md\/normal"/, + replace: '$1"heading-sm/normal"' } ] },