From 26829a4204c3f6828e2b3d699f5128befc11cddc Mon Sep 17 00:00:00 2001 From: thororen <78185467+thororen1234@users.noreply.github.com> Date: Thu, 19 Mar 2026 04:01:13 -0400 Subject: [PATCH 1/4] ReviewDB: various fixes (#4062) * fix regression that only showed 4 reviews per page * Newest to oldest review sort * filter out system on preview * fix broken pfps rendering as error image * fix contrast on white profiles --------- Co-authored-by: Vendicated --- src/components/BaseText.css | 5 +- src/components/BaseText.tsx | 4 +- src/plugins/anonymiseFileNames/index.tsx | 4 +- .../reviewDB/components/ReviewComponent.tsx | 5 +- .../reviewDB/components/ReviewsView.tsx | 3 +- src/plugins/reviewDB/index.tsx | 57 ++++++++++++------- src/plugins/reviewDB/reviewDbApi.ts | 16 +++--- src/plugins/reviewDB/style.css | 5 ++ 8 files changed, 65 insertions(+), 34 deletions(-) diff --git a/src/components/BaseText.css b/src/components/BaseText.css index d322a5679..cd7f8c0cd 100644 --- a/src/components/BaseText.css +++ b/src/components/BaseText.css @@ -1,8 +1,11 @@ .vc-text-base { font-family: var(--font-primary); - color: var(--text-default); line-height: normal; /* Discord puts an insane default margin on p tags, so reset that here */ margin: 0; +} + +.vc-text-defaultColor { + color: var(--text-default); } \ No newline at end of file diff --git a/src/components/BaseText.tsx b/src/components/BaseText.tsx index 7ce49d69f..dfabcdb48 100644 --- a/src/components/BaseText.tsx +++ b/src/components/BaseText.tsx @@ -56,6 +56,7 @@ export type BaseTextProps = ComponentPropsWithoutRe size?: TextSize; weight?: TextWeight; tag?: Tag; + defaultColor?: boolean; }; export function BaseText(props: BaseTextProps): ReactNode { @@ -63,13 +64,14 @@ export function BaseText(props: BaseTextProps): Re size = "md", weight = "normal", tag: Tag = "div", + defaultColor = true, children, className, ...restProps } = props; return ( - + {children} ); diff --git a/src/plugins/anonymiseFileNames/index.tsx b/src/plugins/anonymiseFileNames/index.tsx index 9b7690f34..6b4a5a9ab 100644 --- a/src/plugins/anonymiseFileNames/index.tsx +++ b/src/plugins/anonymiseFileNames/index.tsx @@ -53,7 +53,7 @@ const settings = definePluginSettings({ randomisedLength: { description: "Random characters length", type: OptionType.NUMBER, - default: 10, + default: 7, disabled: () => settings.store.method !== Methods.Random, }, consistent: { @@ -123,7 +123,7 @@ export default definePlugin({ const newFilename = (() => { switch (settings.store.method) { case Methods.Random: - const chars = "ABCDEFabcdef0123456789"; + const chars = "0123456789bdfhjkmnpqrstvwxz"; return Array.from( { length: settings.store.randomisedLength }, () => chars[Math.floor(Math.random() * chars.length)] diff --git a/src/plugins/reviewDB/components/ReviewComponent.tsx b/src/plugins/reviewDB/components/ReviewComponent.tsx index 20bd2e029..a29bd504c 100644 --- a/src/plugins/reviewDB/components/ReviewComponent.tsx +++ b/src/plugins/reviewDB/components/ReviewComponent.tsx @@ -24,7 +24,7 @@ import { canBlockReviewAuthor, canDeleteReview, canReportReview, cl, showToast } import { openUserProfile } from "@utils/discord"; import { classes } from "@utils/misc"; import { findCssClassesLazy } from "@webpack"; -import { Alerts, Parser, Timestamp, useState } from "@webpack/common"; +import { Alerts, IconUtils, Parser, Timestamp, useState } from "@webpack/common"; import { openBlockModal } from "./BlockedUserModal"; import { BlockButton, DeleteButton, ReportButton } from "./MessageButton"; @@ -116,8 +116,9 @@ export default function ReviewComponent({ review, refetch, profileId }: { review e.currentTarget.src = IconUtils.getDefaultAvatarURL(review.sender.discordID)} />
getReviews(discordId, (page - 1) * REVIEWS_PER_PAGE), { + const [reviewData] = useAwaiter(() => getReviews(discordId, { offset: (page - 1) * REVIEWS_PER_PAGE }), { fallbackValue: null, deps: [refetchSignal, signal, page], onSuccess: data => { if (settings.store.hideBlockedUsers) data!.reviews = data!.reviews?.filter(r => !RelationshipStore.isBlocked(r.sender.discordID)); + data!.reviews.reverse(); scrollToTop?.(); onFetchReviews(data!); } diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index 51e0a3f3e..647d716ae 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -29,14 +29,14 @@ import { useAwaiter } from "@utils/react"; import definePlugin from "@utils/types"; import { Guild, User } from "@vencord/discord-types"; import { findCssClassesLazy } from "@webpack"; -import { Alerts, Clickable, Menu, Parser } from "@webpack/common"; +import { Alerts, Clickable, IconUtils, Menu, Parser } from "@webpack/common"; import { Auth, initAuth, updateAuth } from "./auth"; import { openReviewsModal } from "./components/ReviewModal"; import { NotificationType, ReviewType } from "./entities"; import { getCurrentUserInfo, getReviews, readNotification } from "./reviewDbApi"; import { settings } from "./settings"; -import { showToast } from "./utils"; +import { cl, showToast } from "./utils"; const DMSideBarClasses = findCssClassesLazy("widgetPreviews"); const ProfileCardClasses = findCssClassesLazy("cardsList", "firstCardContainer", "card", "container"); @@ -155,7 +155,7 @@ export default definePlugin({ }, renderProfileComponent: ErrorBoundary.wrap(({ user, isSideBar = false }: { user: User; isSideBar?: boolean; }) => { - const [reviewData] = useAwaiter(() => getReviews(user.id), { deps: [user.id], fallbackValue: null }); + const [reviewData] = useAwaiter(() => getReviews(user.id, { limit: 4 }), { deps: [user.id], fallbackValue: null }); // Discord are masters at using a crap ton of html elements and css classes to create a simple ui that could have // been made with less than half of the number of elements, so we have to do this insanity to replicate their ui @@ -163,27 +163,44 @@ export default definePlugin({
  • - openReviewsModal(user.id, user.username, ReviewType.User)}> + !reviewData?.hasOptedOut && openReviewsModal(user.id, user.username, ReviewType.User)} + >
    User Reviews - {!!reviewData?.reviewCount && ( -
    - {reviewData.reviews.slice(0, 4).map((review, idx) => { - const showCount = idx === 3 && reviewData.reviewCount > 4; + {!!reviewData?.reviewCount + ? ( +
    + {reviewData.reviews + .filter(review => review.id !== 0) + .slice(0, 4) + .reverse() + .map((review, idx) => { + const showCount = idx === 3 && reviewData.reviewCount > 4; - return ( -
    - {review.sender.username} - {showCount && ( -
    - +{reviewData.reviewCount - 3} + return ( +
    + {review.sender.username} e.currentTarget.src = IconUtils.getDefaultAvatarURL(review.sender.discordID)} + /> + {showCount && ( +
    + + +{reviewData.reviewCount - 3} + +
    + )}
    - )} -
    - ); - })} -
    - )} + ); + })} +
    + ) + : {reviewData?.hasOptedOut ? "User opted out" : "No reviews yet"} + }
  • diff --git a/src/plugins/reviewDB/reviewDbApi.ts b/src/plugins/reviewDB/reviewDbApi.ts index e899216a3..94c369770 100644 --- a/src/plugins/reviewDB/reviewDbApi.ts +++ b/src/plugins/reviewDB/reviewDbApi.ts @@ -33,6 +33,7 @@ export interface UserReviewsData { updated: boolean; hasNextPage: boolean; reviewCount: number; + hasOptedOut: boolean; } const WarningFlag = 0b00000010; @@ -47,15 +48,15 @@ async function rdbRequest(path: string, options: RequestInit = {}) { }); } -export async function getReviews(id: string, offset = 0): Promise { +export async function getReviews(id: string, { limit, offset = 0 }: { limit?: number; offset?: number; } = {}): Promise { let flags = 0; if (!settings.store.showWarning) flags |= WarningFlag; - const params = new URLSearchParams({ - flags: String(flags), - offset: String(offset), - limit: "4" - }); + const params = new URLSearchParams(); + if (flags) params.append("flags", String(flags)); + if (offset) params.append("offset", String(offset)); + if (limit) params.append("limit", String(limit)); + const req = await fetch(`${API_URL}/users/${id}/reviews?${params}`); const res = (req.ok) @@ -65,7 +66,8 @@ export async function getReviews(id: string, offset = 0): Promise Date: Thu, 19 Mar 2026 09:04:24 +0100 Subject: [PATCH 2/4] fix SpotifyControls, GameActivityToggle & AccPanelServerProfile (#4059) --- src/plugins/accountPanelServerProfile/index.tsx | 4 ++-- src/plugins/decor/index.tsx | 2 +- src/plugins/gameActivityToggle/index.tsx | 2 +- src/plugins/newGuildSettings/index.tsx | 10 ++++++++-- src/plugins/spotifyControls/index.tsx | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/plugins/accountPanelServerProfile/index.tsx b/src/plugins/accountPanelServerProfile/index.tsx index f735ccbf7..f7a5b5ea4 100644 --- a/src/plugins/accountPanelServerProfile/index.tsx +++ b/src/plugins/accountPanelServerProfile/index.tsx @@ -67,11 +67,11 @@ export default definePlugin({ patches: [ { - find: ".WIDGETS_RTC_UPSELL_COACHMARK)", + find: "handleOpenSettingsContextMenu=", group: true, replacement: [ { - match: /(\.AVATAR,children:.+?renderPopout:\((\i),\i\)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/, + match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/, replace: (_, rest, popoutProps, originalPopout, currentUser) => `${rest}$self.UserProfile({popoutProps:${popoutProps},currentUser:${currentUser},originalRenderPopout:()=>{${originalPopout}}})` }, { diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 30100d1d6..fc2e93a99 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -87,7 +87,7 @@ export default definePlugin({ }, // Current user area, at bottom of channels/dm list { - find: ".DISPLAY_NAME_STYLES_COACHMARK),", + find: ".DISPLAY_NAME_STYLES_COACHMARK)", replacement: [ // Use Decor avatar decoration hook { diff --git a/src/plugins/gameActivityToggle/index.tsx b/src/plugins/gameActivityToggle/index.tsx index 0a0e792d3..102ee3cf4 100644 --- a/src/plugins/gameActivityToggle/index.tsx +++ b/src/plugins/gameActivityToggle/index.tsx @@ -112,7 +112,7 @@ export default definePlugin({ patches: [ { - find: ".DISPLAY_NAME_STYLES_COACHMARK),", + find: ".DISPLAY_NAME_STYLES_COACHMARK)", replacement: { match: /children:\[(?=.{0,25}?accountContainerRef)/, replace: "children:[$self.GameActivityToggleButton(arguments[0])," diff --git a/src/plugins/newGuildSettings/index.tsx b/src/plugins/newGuildSettings/index.tsx index fba0c1c3a..7d8687d30 100644 --- a/src/plugins/newGuildSettings/index.tsx +++ b/src/plugins/newGuildSettings/index.tsx @@ -26,7 +26,7 @@ import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { Guild } from "@vencord/discord-types"; import { findByCodeLazy, findByPropsLazy, mapMangledModuleLazy } from "@webpack"; -import { Menu } from "@webpack/common"; +import { Menu, UserStore } from "@webpack/common"; const { updateGuildNotificationSettings } = findByPropsLazy("updateGuildNotificationSettings"); const { toggleShowAllChannels } = mapMangledModuleLazy(".onboardExistingMember(", { @@ -141,5 +141,11 @@ export default definePlugin({ } ], settings, - applyDefaultSettings + applyDefaultSettings, + flux: { + GUILD_JOIN_REQUEST_UPDATE({ guildId, request, status }) { + if (status === "APPROVED" && request.user_id === UserStore.getCurrentUser().id) + applyDefaultSettings(guildId); + } + } }); diff --git a/src/plugins/spotifyControls/index.tsx b/src/plugins/spotifyControls/index.tsx index f476165e9..a6bc716e8 100644 --- a/src/plugins/spotifyControls/index.tsx +++ b/src/plugins/spotifyControls/index.tsx @@ -53,7 +53,7 @@ export default definePlugin({ }, patches: [ { - find: ".DISPLAY_NAME_STYLES_COACHMARK),", + find: ".DISPLAY_NAME_STYLES_COACHMARK)", replacement: { // react.jsx)(AccountPanel, { ..., showTaglessAccountPanel: blah }) match: /(?<=\i\.jsxs?\)\()(\i),{(?=[^}]*?userTag:\i,occluded:)/, From 567637c737935e264ff3d7b1a3046bc833a58ba0 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 19 Mar 2026 09:32:30 +0100 Subject: [PATCH 3/4] ci: fix resource exhaustion errors --- package.json | 1 + pnpm-lock.yaml | 20 +++++++++++++++++++- src/debug/loadLazyChunks.ts | 20 +++++++++++++------- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 0061e54ae..6722df788 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "highlight.js": "11.11.1", "html-minifier-terser": "^7.2.0", "moment": "^2.22.2", + "p-limit": "^7.3.0", "puppeteer-core": "^24.30.0", "standalone-electron-types": "^34.2.0", "stylelint": "^16.25.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0a0905955..baca9c229 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,6 +98,9 @@ importers: moment: specifier: ^2.22.2 version: 2.30.1 + p-limit: + specifier: ^7.3.0 + version: 7.3.0 puppeteer-core: specifier: ^24.30.0 version: 24.30.0 @@ -966,6 +969,7 @@ packages: basic-ftp@5.0.5: resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} engines: {node: '>=10.0.0'} + deprecated: Security vulnerability fixed in 5.2.0, please upgrade boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -2154,6 +2158,10 @@ packages: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} + p-limit@7.3.0: + resolution: {integrity: sha512-7cIXg/Z0M5WZRblrsOla88S4wAK+zOQQWeBYfV3qJuJXMr+LnbYjaadrFaS0JILfEDPVqHyKnZ1Z/1d6J9VVUw==} + engines: {node: '>=20'} + p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} @@ -2814,6 +2822,10 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + yocto-queue@1.2.2: + resolution: {integrity: sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==} + engines: {node: '>=12.20'} + zip-local@0.3.5: resolution: {integrity: sha512-GRV3D5TJY+/PqyeRm5CYBs7xVrKTKzljBoEXvocZu0HJ7tPEcgpSOYa2zFIsCZWgKWMuc4U3yMFgFkERGFIB9w==} @@ -3193,7 +3205,7 @@ snapshots: '@types/react-dom@18.3.1': dependencies: - '@types/react': 18.3.1 + '@types/react': 19.0.12 '@types/react-dom@19.0.4(@types/react@19.0.12)': dependencies: @@ -4899,6 +4911,10 @@ snapshots: dependencies: yocto-queue: 0.1.0 + p-limit@7.3.0: + dependencies: + yocto-queue: 1.2.2 + p-locate@5.0.0: dependencies: p-limit: 3.1.0 @@ -5726,6 +5742,8 @@ snapshots: yocto-queue@0.1.0: {} + yocto-queue@1.2.2: {} + zip-local@0.3.5: dependencies: async: 1.5.2 diff --git a/src/debug/loadLazyChunks.ts b/src/debug/loadLazyChunks.ts index 94a9f6a3e..cf094f574 100644 --- a/src/debug/loadLazyChunks.ts +++ b/src/debug/loadLazyChunks.ts @@ -9,6 +9,7 @@ import { canonicalizeMatch } from "@utils/patches"; import { ModuleFactory } from "@vencord/discord-types/webpack"; import * as Webpack from "@webpack"; import { wreq } from "@webpack"; +import pLimit from "p-limit"; import { AnyModuleFactory } from "webpack"; function getWebpackChunkMap() { @@ -31,6 +32,7 @@ function getWebpackChunkMap() { export async function loadLazyChunks() { const LazyChunkLoaderLogger = new Logger("LazyChunkLoader"); + const queue = pLimit(50); try { LazyChunkLoaderLogger.log("Loading all chunks..."); @@ -59,11 +61,15 @@ export async function loadLazyChunks() { const shouldForceDefer = false; - await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => { - const chunkIds = rawChunkIds ? Array.from(rawChunkIds.matchAll(Webpack.ChunkIdsRegex)).map(m => { - const numChunkId = Number(m[1]); - return Number.isNaN(numChunkId) ? m[1] : numChunkId; - }) : []; + await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => queue(async () => { + const chunkIds = rawChunkIds + ?.matchAll(Webpack.ChunkIdsRegex) + .map(m => { + const numChunkId = Number(m[1]); + return Number.isNaN(numChunkId) ? m[1] : numChunkId; + }) + .toArray() + ?? []; if (chunkIds.length === 0) { return; @@ -101,13 +107,13 @@ export async function loadLazyChunks() { const numEntryPoint = Number(entryPoint); validChunkGroups.add([chunkIds, Number.isNaN(numEntryPoint) ? entryPoint : numEntryPoint]); } - })); + }))); // Loads all found valid chunk groups await Promise.all( Array.from(validChunkGroups) .map(([chunkIds]) => - Promise.all(chunkIds.map(id => wreq.e(id))) + Promise.all(chunkIds.map(id => queue(() => wreq.e(id)))) ) ); From cdf933120401c06d347ee3d37cd9dadc904480e3 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 19 Mar 2026 09:34:57 +0100 Subject: [PATCH 4/4] Revert "ci: fix resource exhaustion errors" doesnt solve issue guh --- package.json | 1 - pnpm-lock.yaml | 20 +------------------- src/debug/loadLazyChunks.ts | 20 +++++++------------- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index 6722df788..0061e54ae 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,6 @@ "highlight.js": "11.11.1", "html-minifier-terser": "^7.2.0", "moment": "^2.22.2", - "p-limit": "^7.3.0", "puppeteer-core": "^24.30.0", "standalone-electron-types": "^34.2.0", "stylelint": "^16.25.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index baca9c229..0a0905955 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -98,9 +98,6 @@ importers: moment: specifier: ^2.22.2 version: 2.30.1 - p-limit: - specifier: ^7.3.0 - version: 7.3.0 puppeteer-core: specifier: ^24.30.0 version: 24.30.0 @@ -969,7 +966,6 @@ packages: basic-ftp@5.0.5: resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} engines: {node: '>=10.0.0'} - deprecated: Security vulnerability fixed in 5.2.0, please upgrade boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -2158,10 +2154,6 @@ packages: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} - p-limit@7.3.0: - resolution: {integrity: sha512-7cIXg/Z0M5WZRblrsOla88S4wAK+zOQQWeBYfV3qJuJXMr+LnbYjaadrFaS0JILfEDPVqHyKnZ1Z/1d6J9VVUw==} - engines: {node: '>=20'} - p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} @@ -2822,10 +2814,6 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.2.2: - resolution: {integrity: sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==} - engines: {node: '>=12.20'} - zip-local@0.3.5: resolution: {integrity: sha512-GRV3D5TJY+/PqyeRm5CYBs7xVrKTKzljBoEXvocZu0HJ7tPEcgpSOYa2zFIsCZWgKWMuc4U3yMFgFkERGFIB9w==} @@ -3205,7 +3193,7 @@ snapshots: '@types/react-dom@18.3.1': dependencies: - '@types/react': 19.0.12 + '@types/react': 18.3.1 '@types/react-dom@19.0.4(@types/react@19.0.12)': dependencies: @@ -4911,10 +4899,6 @@ snapshots: dependencies: yocto-queue: 0.1.0 - p-limit@7.3.0: - dependencies: - yocto-queue: 1.2.2 - p-locate@5.0.0: dependencies: p-limit: 3.1.0 @@ -5742,8 +5726,6 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.2.2: {} - zip-local@0.3.5: dependencies: async: 1.5.2 diff --git a/src/debug/loadLazyChunks.ts b/src/debug/loadLazyChunks.ts index cf094f574..94a9f6a3e 100644 --- a/src/debug/loadLazyChunks.ts +++ b/src/debug/loadLazyChunks.ts @@ -9,7 +9,6 @@ import { canonicalizeMatch } from "@utils/patches"; import { ModuleFactory } from "@vencord/discord-types/webpack"; import * as Webpack from "@webpack"; import { wreq } from "@webpack"; -import pLimit from "p-limit"; import { AnyModuleFactory } from "webpack"; function getWebpackChunkMap() { @@ -32,7 +31,6 @@ function getWebpackChunkMap() { export async function loadLazyChunks() { const LazyChunkLoaderLogger = new Logger("LazyChunkLoader"); - const queue = pLimit(50); try { LazyChunkLoaderLogger.log("Loading all chunks..."); @@ -61,15 +59,11 @@ export async function loadLazyChunks() { const shouldForceDefer = false; - await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => queue(async () => { - const chunkIds = rawChunkIds - ?.matchAll(Webpack.ChunkIdsRegex) - .map(m => { - const numChunkId = Number(m[1]); - return Number.isNaN(numChunkId) ? m[1] : numChunkId; - }) - .toArray() - ?? []; + await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => { + const chunkIds = rawChunkIds ? Array.from(rawChunkIds.matchAll(Webpack.ChunkIdsRegex)).map(m => { + const numChunkId = Number(m[1]); + return Number.isNaN(numChunkId) ? m[1] : numChunkId; + }) : []; if (chunkIds.length === 0) { return; @@ -107,13 +101,13 @@ export async function loadLazyChunks() { const numEntryPoint = Number(entryPoint); validChunkGroups.add([chunkIds, Number.isNaN(numEntryPoint) ? entryPoint : numEntryPoint]); } - }))); + })); // Loads all found valid chunk groups await Promise.all( Array.from(validChunkGroups) .map(([chunkIds]) => - Promise.all(chunkIds.map(id => queue(() => wreq.e(id)))) + Promise.all(chunkIds.map(id => wreq.e(id))) ) );