Fix persisting $$vencordPatchedSource when a module is loaded again
This commit is contained in:
parent
3d80cb2d55
commit
66b247b2d3
|
@ -355,8 +355,16 @@ function patchFactories(factories: Record<string, (module: any, exports: any, re
|
||||||
if (!patch.all) patches.splice(i--, 1);
|
if (!patch.all) patches.splice(i--, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_DEV && mod !== originalMod) {
|
if (IS_DEV) {
|
||||||
factory.$$vencordPatchedSource = String(mod);
|
if (mod !== originalMod) {
|
||||||
|
factory.$$vencordPatchedSource = String(mod);
|
||||||
|
} else if (wreq != null) {
|
||||||
|
const existingFactory = wreq.m[id];
|
||||||
|
|
||||||
|
if (existingFactory != null) {
|
||||||
|
factory.$$vencordPatchedSource = existingFactory.$$vencordPatchedSource;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue