mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 21:53:04 -04:00
fix ContextMenus on canary
This commit is contained in:
parent
e69575f273
commit
d542095993
2 changed files with 15 additions and 10 deletions
|
@ -27,10 +27,13 @@ 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 is in this case the MenuCheckBoxItem instead of the entire module
|
||||||
const module = wreq(id);
|
const module = wreq(id);
|
||||||
|
|
||||||
for (const e of Object.values(module)) {
|
for (const key in module) {
|
||||||
if (typeof e === "function" && e.name.startsWith("Menu")) {
|
try {
|
||||||
Menu[e.name] = e;
|
const e = module[key];
|
||||||
}
|
if (typeof e === "function" && e.name.startsWith("Menu")) {
|
||||||
|
Menu[e.name] = e;
|
||||||
|
}
|
||||||
|
} catch { }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -445,13 +445,15 @@ function runFactoryWithWrap(patchedFactory: PatchedModuleFactory, thisArg: unkno
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const exportKey in exports) {
|
for (const exportKey in exports) {
|
||||||
const exportValue = exports[exportKey];
|
try {
|
||||||
|
const exportValue = exports[exportKey];
|
||||||
|
|
||||||
if (exportValue != null && filter(exportValue)) {
|
if (exportValue != null && filter(exportValue)) {
|
||||||
waitForSubscriptions.delete(filter);
|
waitForSubscriptions.delete(filter);
|
||||||
callback(exportValue, module.id);
|
callback(exportValue, module.id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} catch { }
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error("Error while firing callback for Webpack waitFor subscription:\n", err, filter, callback);
|
logger.error("Error while firing callback for Webpack waitFor subscription:\n", err, filter, callback);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue