Make eagerPatches an internal setting
This commit is contained in:
parent
7b7b87316d
commit
bdd4b0f143
|
@ -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",
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue