Fix persisting $$vencordPatchedSource when a module is loaded again
This commit is contained in:
parent
3d80cb2d55
commit
66b247b2d3
1 changed files with 10 additions and 2 deletions
|
@ -355,8 +355,16 @@ function patchFactories(factories: Record<string, (module: any, exports: any, re
|
|||
if (!patch.all) patches.splice(i--, 1);
|
||||
}
|
||||
|
||||
if (IS_DEV && mod !== originalMod) {
|
||||
if (IS_DEV) {
|
||||
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