mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03:03 -04:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
62b8997443
3 changed files with 26 additions and 7 deletions
|
@ -23,12 +23,19 @@ export const Menu = {} as t.Menu;
|
||||||
|
|
||||||
// Relies on .name properties added by the MenuItemDemanglerAPI
|
// Relies on .name properties added by the MenuItemDemanglerAPI
|
||||||
waitFor(m => m.name === "MenuCheckboxItem", (_, id) => {
|
waitFor(m => m.name === "MenuCheckboxItem", (_, id) => {
|
||||||
// we have to do this manual require by ID because m is in this case the MenuCheckBoxItem instead of the entire module
|
// We have to do this manual require by ID because m in this case is the MenuCheckBoxItem instead of the entire module
|
||||||
const module = wreq(id);
|
const exports = wreq(id);
|
||||||
|
|
||||||
for (const e of Object.values(module)) {
|
for (const exportKey in exports) {
|
||||||
if (typeof e === "function" && e.name.startsWith("Menu")) {
|
// Some exports might have not been initialized yet due to circular imports, so try catch it.
|
||||||
Menu[e.name] = e;
|
try {
|
||||||
|
var exportValue = exports[exportKey];
|
||||||
|
} catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof exportValue === "function" && exportValue.name.startsWith("Menu")) {
|
||||||
|
Menu[exportValue.name] = exportValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -442,7 +442,12 @@ function runFactoryWithWrap(patchedFactory: PatchedModuleFactory, thisArg: unkno
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const exportKey in exports) {
|
for (const exportKey in exports) {
|
||||||
const exportValue = exports[exportKey];
|
// Some exports might have not been initialized yet due to circular imports, so try catch it.
|
||||||
|
try {
|
||||||
|
var exportValue = exports[exportKey];
|
||||||
|
} catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (exportValue != null && filter(exportValue)) {
|
if (exportValue != null && filter(exportValue)) {
|
||||||
waitForSubscriptions.delete(filter);
|
waitForSubscriptions.delete(filter);
|
||||||
|
|
|
@ -156,7 +156,14 @@ export function _blacklistBadModules(requireCache: NonNullable<AnyWebpackRequire
|
||||||
|
|
||||||
let hasOnlyBadProperties = true;
|
let hasOnlyBadProperties = true;
|
||||||
for (const exportKey in exports) {
|
for (const exportKey in exports) {
|
||||||
if (shouldIgnoreValue(exports[exportKey])) {
|
// Some exports might have not been initialized yet due to circular imports, so try catch it.
|
||||||
|
try {
|
||||||
|
var exportValue = exports[exportKey];
|
||||||
|
} catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldIgnoreValue(exportValue)) {
|
||||||
makePropertyNonEnumerable(exports, exportKey);
|
makePropertyNonEnumerable(exports, exportKey);
|
||||||
} else {
|
} else {
|
||||||
hasOnlyBadProperties = false;
|
hasOnlyBadProperties = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue