mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 05:42:55 -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
|
||||
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
|
||||
const module = wreq(id);
|
||||
// We have to do this manual require by ID because m in this case is the MenuCheckBoxItem instead of the entire module
|
||||
const exports = wreq(id);
|
||||
|
||||
for (const e of Object.values(module)) {
|
||||
if (typeof e === "function" && e.name.startsWith("Menu")) {
|
||||
Menu[e.name] = e;
|
||||
for (const exportKey in exports) {
|
||||
// Some exports might have not been initialized yet due to circular imports, so try catch it.
|
||||
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) {
|
||||
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)) {
|
||||
waitForSubscriptions.delete(filter);
|
||||
|
|
|
@ -156,7 +156,14 @@ export function _blacklistBadModules(requireCache: NonNullable<AnyWebpackRequire
|
|||
|
||||
let hasOnlyBadProperties = true;
|
||||
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);
|
||||
} else {
|
||||
hasOnlyBadProperties = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue