diff --git a/src/debug/loadLazyChunks.ts b/src/debug/loadLazyChunks.ts index d3484bd9a..73a89504f 100644 --- a/src/debug/loadLazyChunks.ts +++ b/src/debug/loadLazyChunks.ts @@ -134,7 +134,7 @@ export async function loadLazyChunks() { const allChunks = [] as number[]; // Matches "id" or id: - for (const currentMatch of wreq!.u.toString().matchAll(/(?:"([\deE]+?)")|(?:([\deE]+?):)/g)) { + for (const currentMatch of wreq!.u.toString().matchAll(/(?:"([\deE]+?)"(?![,}]))|(?:([\deE]+?):)/g)) { const id = currentMatch[1] ?? currentMatch[2]; if (id == null) continue; diff --git a/src/plugins/_api/badges/index.tsx b/src/plugins/_api/badges/index.tsx index 89a992ac3..cf00a0e29 100644 --- a/src/plugins/_api/badges/index.tsx +++ b/src/plugins/_api/badges/index.tsx @@ -62,34 +62,6 @@ export default definePlugin({ authors: [Devs.Megu, Devs.Ven, Devs.TheSun], required: true, patches: [ - /* Patch the badge list component on user profiles */ - { - find: 'id:"premium",', - replacement: [ - { - match: /&&(\i)\.push\(\{id:"premium".+?\}\);/, - replace: "$&$1.unshift(...$self.getBadges(arguments[0]));", - }, - { - // alt: "", aria-hidden: false, src: originalSrc - match: /alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/, - // ...badge.props, ..., src: badge.image ?? ... - replace: "...$1.props,$& $1.image??" - }, - // replace their component with ours if applicable - { - match: /(?<=text:(\i)\.description,spacing:12,.{0,50})children:/, - replace: "children:$1.component ? () => $self.renderBadgeComponent($1) :" - }, - // conditionally override their onClick with badge.onClick if it exists - { - match: /href:(\i)\.link/, - replace: "...($1.onClick && { onClick: vcE => $1.onClick(vcE, $1) }),$&" - } - ] - }, - - /* new profiles */ { find: ".FULL_SIZE]:26", replacement: { diff --git a/src/plugins/betterNotes/index.tsx b/src/plugins/betterNotes/index.tsx index b97076bf4..63fcf6477 100644 --- a/src/plugins/betterNotes/index.tsx +++ b/src/plugins/betterNotes/index.tsx @@ -17,13 +17,9 @@ */ import { definePluginSettings, Settings } from "@api/Settings"; -import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import { canonicalizeMatch } from "@utils/patches"; import definePlugin, { OptionType } from "@utils/types"; -import { findByPropsLazy } from "@webpack"; - -const UserPopoutSectionCssClasses = findByPropsLazy("section", "lastSection"); const settings = definePluginSettings({ hide: { @@ -72,23 +68,9 @@ export default definePlugin({ match: /\.NOTE_PLACEHOLDER,/, replace: "$&spellCheck:!$self.noSpellCheck," } - }, - { - find: ".popularApplicationCommandIds,", - replacement: { - match: /lastSection:(!?\i)}\),/, - replace: "$&$self.patchPadding({lastSection:$1})," - } } ], - patchPadding: ErrorBoundary.wrap(({ lastSection }) => { - if (!lastSection) return null; - return ( -
- ); - }), - get noSpellCheck() { return settings.store.noSpellCheck; } diff --git a/src/plugins/fakeProfileThemes/index.tsx b/src/plugins/fakeProfileThemes/index.tsx index ab240837b..708c961aa 100644 --- a/src/plugins/fakeProfileThemes/index.tsx +++ b/src/plugins/fakeProfileThemes/index.tsx @@ -121,7 +121,7 @@ export default definePlugin({ { find: "UserProfileStore", replacement: { - match: /(?<=getUserProfile\(\i\){return )(\i\[\i\])/, + match: /(?<=getUserProfile\(\i\){return )(.+?)(?=})/, replace: "$self.colorDecodeHook($1)" } }, diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index 717bd754c..0399a2f72 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -16,7 +16,6 @@ const containerWrapper = findByPropsLazy("memberSinceWrapper"); const container = findByPropsLazy("memberSince"); const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"'); const locale = findByPropsLazy("getLocale"); -const lastSection = findByPropsLazy("lastSection"); const section = findLazy((m: any) => m.section !== void 0 && m.heading !== void 0 && Object.values(m).length === 2); export default definePlugin({ @@ -24,31 +23,7 @@ export default definePlugin({ description: "Shows when you became friends with someone in the user popout", authors: [Devs.Elvyra, Devs.Antti], patches: [ - // User popup - old layout - { - find: ".USER_PROFILE}};return", - replacement: { - match: /,{userId:(\i.id).{0,30}}\)/, - replace: "$&,$self.friendsSinceOld({ userId: $1 })" - } - }, - // DM User Sidebar - old layout - { - find: ".PROFILE_PANEL,", - replacement: { - match: /,{userId:([^,]+?)}\)/, - replace: "$&,$self.friendsSinceOld({ userId: $1 })" - } - }, - // User Profile Modal - old layout - { - find: ".userInfoSectionHeader,", - replacement: { - match: /(\.Messages\.USER_PROFILE_MEMBER_SINCE.+?userId:(.+?),textClassName:)(\i\.userInfoText)}\)/, - replace: (_, rest, userId, textClassName) => `${rest}!$self.getFriendSince(${userId}) ? ${textClassName} : void 0 }), $self.friendsSinceOld({ userId: ${userId}, textClassName: ${textClassName} })` - } - }, - // DM User Sidebar - new layout + // DM User Sidebar { find: ".PANEL}),nicknameIcons", replacement: { @@ -56,7 +31,7 @@ export default definePlugin({ replace: "$&,$self.friendsSinceNew({userId:$1,isSidebar:true})" } }, - // User Profile Modal - new layout + // User Profile Modal { find: "action:\"PRESS_APP_CONNECTION\"", replacement: { @@ -77,39 +52,6 @@ export default definePlugin({ } }, - friendsSinceOld: ErrorBoundary.wrap(({ userId, textClassName }: { userId: string; textClassName?: string; }) => { - if (!RelationshipStore.isFriend(userId)) return null; - - const friendsSince = RelationshipStore.getSince(userId); - if (!friendsSince) return null; - - return ( -