Make eagerPatches an internal setting

This commit is contained in:
Nuckyz 2024-05-23 19:53:19 -03:00
parent 7b7b87316d
commit bdd4b0f143
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 12 additions and 10 deletions

View file

@ -66,11 +66,6 @@ function VencordSettings() {
title: "Enable React Developer Tools",
note: "Requires a full restart"
},
{
key: "eagerPatches",
title: "Apply Vencord patches before they are needed",
note: "Increases startup timing, but may make app usage more fluid. Note that the difference of having this on or off is minimal."
},
!IS_WEB && (!IS_DISCORD_DESKTOP || !isWindows ? {
key: "frameless",
title: "Disable the window frame",

View file

@ -127,10 +127,17 @@ Object.defineProperty(Function.prototype, "O", {
configurable: true,
set(v: OnChunksLoaded["j"]) {
// @ts-ignore
delete onChunksLoaded.j;
onChunksLoaded.j = v;
originalOnChunksLoaded.j = v;
function setValue(target: any) {
Object.defineProperty(target, "j", {
value: v,
configurable: true,
enumerable: true,
writable: true
});
}
setValue(onChunksLoaded);
setValue(originalOnChunksLoaded);
}
});
}
@ -318,7 +325,7 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) {
// @ts-ignore
originalFactory.$$vencordRequired = true;
for (const proxiedModules of allProxiedModules) {
proxiedModules[id] = originalFactory;
Reflect.set(proxiedModules, id, originalFactory);
}
if (wreq == null && IS_DEV) {