From 61b916cab3cd28a065004e646ae58125977aecc6 Mon Sep 17 00:00:00 2001 From: sadan4 <117494111+sadan4@users.noreply.github.com> Date: Thu, 5 Feb 2026 21:25:59 -0500 Subject: [PATCH 1/3] fix a few more things (#3969) --- src/plugins/betterFolders/index.tsx | 9 ++++++++- src/plugins/replyTimestamp/index.tsx | 3 ++- src/plugins/validReply/index.ts | 1 + src/webpack/common/utils.ts | 4 ++-- src/webpack/patchWebpack.ts | 6 ++++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/plugins/betterFolders/index.tsx b/src/plugins/betterFolders/index.tsx index cee1a6d05..fe312f1a9 100644 --- a/src/plugins/betterFolders/index.tsx +++ b/src/plugins/betterFolders/index.tsx @@ -21,6 +21,7 @@ import "./style.css"; import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import { getIntlMessage } from "@utils/discord"; +import { Logger } from "@utils/Logger"; import definePlugin, { OptionType } from "@utils/types"; import { findByPropsLazy, findStoreLazy } from "@webpack"; import { FluxDispatcher } from "@webpack/common"; @@ -341,7 +342,13 @@ export default definePlugin({ } try { - return child?.props?.["aria-label"] === getIntlMessage("SERVERS"); + // can cause hang if intl message is not found + const serversIntlMsg = getIntlMessage("SERVERS"); + if (!serversIntlMsg) { + new Logger("BetterFolders").error("Failed to get SERVERS intl message"); + return true; + } + return child?.props?.["aria-label"] === serversIntlMsg; } catch (e) { console.error(e); return true; diff --git a/src/plugins/replyTimestamp/index.tsx b/src/plugins/replyTimestamp/index.tsx index 7391153b8..65e969241 100644 --- a/src/plugins/replyTimestamp/index.tsx +++ b/src/plugins/replyTimestamp/index.tsx @@ -62,7 +62,8 @@ export default definePlugin({ patches: [ { - find: "#{intl::REPLY_QUOTE_MESSAGE_BLOCKED}", + // Same find as in ValidReply + find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}", replacement: { match: /\.onClickReply,.+?}\),(?=\i,\i,\i\])/, replace: "$&$self.ReplyTimestamp(arguments[0])," diff --git a/src/plugins/validReply/index.ts b/src/plugins/validReply/index.ts index 4c1477240..5091f604c 100644 --- a/src/plugins/validReply/index.ts +++ b/src/plugins/validReply/index.ts @@ -36,6 +36,7 @@ export default definePlugin({ authors: [Devs.newwares], patches: [ { + // Same find as in ReplyTimestamp find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}", replacement: { match: /#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}\)/, diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index 368d4d108..e740a4079 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -203,8 +203,8 @@ export const DisplayProfileUtils: t.DisplayProfileUtils = mapMangledModuleLazy(/ }); export const DateUtils: t.DateUtils = mapMangledModuleLazy("millisecondsInUnit:", { - calendarFormat: filters.byCode("sameElse"), - dateFormat: filters.byCode('":'), + calendarFormat: filters.byCode('<-1?"sameElse":'), + dateFormat: filters.byCode('<2?"nextDay":"sameElse";'), isSameDay: filters.byCode(/Math\.abs\(\i-\i\)/), diffAsUnits: filters.byCode("days:0", "millisecondsInUnit") }); diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 11045e9a1..1eeb10ed3 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -28,7 +28,7 @@ export const patchTimings = [] as Array<[plugin: string, moduleId: PropertyKey, export const getBuildNumber = makeLazy(() => { try { function matchBuildNumber(factoryStr: string) { - const buildNumberMatch = factoryStr.match(/.concat\("(\d+?)"\)/); + const buildNumberMatch = factoryStr.match(/"Trying to open a changelog for an invalid build number (\d+?)"\)/); if (buildNumberMatch == null) { return -1; } @@ -36,13 +36,15 @@ export const getBuildNumber = makeLazy(() => { return Number(buildNumberMatch[1]); } - const hardcodedFactoryStr = String(wreq.m[128014]); + const hardcodedFactoryStr = String(wreq.m[446023]); if (hardcodedFactoryStr.includes("Trying to open a changelog for an invalid build number")) { const hardcodedBuildNumber = matchBuildNumber(hardcodedFactoryStr); if (hardcodedBuildNumber !== -1) { return hardcodedBuildNumber; } + } else if (IS_DEV || IS_REPORTER) { + logger.error("Hardcoded build number module id is invalid"); } const moduleFactory = findModuleFactory("Trying to open a changelog for an invalid build number"); From 07d63e31ad8cf1ff3e6f8b5bd36af6210a141dfa Mon Sep 17 00:00:00 2001 From: Vendicated Date: Fri, 6 Feb 2026 03:34:29 +0100 Subject: [PATCH 2/3] fix Translate & VcNarrator --- packages/discord-types/src/components.d.ts | 2 +- src/plugins/translate/TranslateModal.tsx | 4 ++-- src/plugins/vcNarrator/VoiceSetting.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/discord-types/src/components.d.ts b/packages/discord-types/src/components.d.ts index f0675ca48..9a394677f 100644 --- a/packages/discord-types/src/components.d.ts +++ b/packages/discord-types/src/components.d.ts @@ -243,7 +243,7 @@ export type Select = ComponentType; // TODO - value?: SelectOption; + value?: any; /** * - 0 ~ Filled diff --git a/src/plugins/translate/TranslateModal.tsx b/src/plugins/translate/TranslateModal.tsx index 49b75bb5c..0b343eb1a 100644 --- a/src/plugins/translate/TranslateModal.tsx +++ b/src/plugins/translate/TranslateModal.tsx @@ -48,8 +48,8 @@ function LanguageSelect({ settingsKey, includeAuto }: { settingsKey: typeof Lang o.value === currentValue)} - placeholder={"Select a language"} + value={options.find(o => o.value === currentValue)?.value} + placeholder="Select a language" maxVisibleItems={5} closeOnSelect={true} onChange={v => settings.store[settingsKey] = v} diff --git a/src/plugins/vcNarrator/VoiceSetting.tsx b/src/plugins/vcNarrator/VoiceSetting.tsx index 87869c933..2daf86386 100644 --- a/src/plugins/vcNarrator/VoiceSetting.tsx +++ b/src/plugins/vcNarrator/VoiceSetting.tsx @@ -36,7 +36,7 @@ function SimplePicker({ voice, voices }: PickerProps) { placeholder="Select a voice" maxVisibleItems={5} options={options} - value={options.find(o => o.value === voice)} + value={options.find(o => o.value === voice)?.value} onChange={v => settings.store.voice = v} closeOnSelect /> @@ -87,7 +87,7 @@ function ComplexPicker({ voice, voices }: PickerProps) { l.value === selectedLanguage)} + value={languageOptions.find(l => l.value === selectedLanguage)?.value} onChange={v => setSelectedLanguage(v)} maxVisibleItems={5} closeOnSelect From 141bb41d950ace22a9a044368c9f6fb0a69eab24 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 5 Feb 2026 23:29:47 -0500 Subject: [PATCH 3/3] StickerBlocker: Fix --- src/equicordplugins/stickerBlocker/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/equicordplugins/stickerBlocker/index.tsx b/src/equicordplugins/stickerBlocker/index.tsx index 66656cda3..1993ebabb 100644 --- a/src/equicordplugins/stickerBlocker/index.tsx +++ b/src/equicordplugins/stickerBlocker/index.tsx @@ -135,7 +135,7 @@ export default definePlugin({ { find: ".STICKERS_CONSTANTS_STICKER_DIMENSION)", replacement: { - match: /}\),\(\i\?\?\i\)\.name\]\}\);/, + match: /}\),\(\i\?\?(\i)\)\.name\]\}\);/, replace: "$& if($self.isBlocked($1.id)) return($self.blockedComponent($1));" } }