Only add ifs if IS_DEV

This commit is contained in:
Nuckyz 2024-08-20 04:09:39 -03:00
parent e8965866e6
commit 464dddff13
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -168,7 +168,7 @@ function updateExistingFactory(moduleFactoriesTarget: AnyWebpackRequire["m"], id
}
// Persist $$vencordPatchedSource in the new original factory, if the patched one has already been required
if (existingFactory.value != null) {
if (IS_DEV && existingFactory.value != null) {
newFactory.$$vencordPatchedSource = existingFactory.value.$$vencordPatchedSource;
}
@ -213,7 +213,7 @@ function defineModulesFactoryGetter(id: PropertyKey, factory: WrappedModuleFacto
return (factory = wrapAndPatchFactory(id, factory));
},
set(newFactory: AnyModuleFactory) {
if (factory.$$vencordPatchedSource != null) {
if (IS_DEV && factory.$$vencordPatchedSource != null) {
newFactory.$$vencordPatchedSource = factory.$$vencordPatchedSource;
}