Merge branch 'immediate-finds' into immediate-finds-modules-proxy

This commit is contained in:
Nuckyz 2024-07-19 01:01:32 -03:00
commit 2df13a2e17
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
3 changed files with 4 additions and 4 deletions

View file

@ -136,7 +136,7 @@ export async function loadLazyChunks() {
const allChunks = [] as number[];
// Matches "id" or id:
for (const currentMatch of String(wreq.u).matchAll(/(?:"([\de]+?)")|(?:([\de]+?):)/g)) {
for (const currentMatch of wreq!.u.toString().matchAll(/(?:"([\deE]+?)")|(?:([\deE]+?):)/g)) {
const id = currentMatch[1] ?? currentMatch[2];
if (id == null) continue;

View file

@ -52,7 +52,7 @@ export default definePlugin({
{
find: ".PANEL}),nicknameIcons",
replacement: {
match: /USER_PROFILE_MEMBER_SINCE,.{0,100}userId:(\i\.id)}\)}\)/,
match: /BOT_PROFILE_CREATED_ON,.{0,100}userId:(\i\.id)}\)}\)/,
replace: "$&,$self.friendsSinceNew({userId:$1,isSidebar:true})"
}
},

View file

@ -593,7 +593,7 @@ export function extractAndLoadChunksLazy(code: string | RegExp | CodeFilter, mat
}
if (rawChunkIds) {
const chunkIds = Array.from(rawChunkIds.matchAll(ChunkIdsRegex)).map(m => m[1]);
const chunkIds = Array.from(rawChunkIds.matchAll(ChunkIdsRegex)).map(m => Number(m[1]));
await Promise.all(chunkIds.map(id => wreq.e(id)));
}
@ -608,7 +608,7 @@ export function extractAndLoadChunksLazy(code: string | RegExp | CodeFilter, mat
}
}
wreq(entryPointId);
wreq(Number(entryPointId));
return true;
});