Merge remote-tracking branch 'upstream/dev' into dev
Some checks failed
Release / Build Equicord (push) Has been cancelled
Test / Test (push) Has been cancelled

This commit is contained in:
thororen1234 2025-05-16 15:26:43 -04:00
commit b17b248f74
No known key found for this signature in database
3 changed files with 17 additions and 11 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "equicord", "name": "equicord",
"private": "true", "private": "true",
"version": "1.12.1", "version": "1.12.2",
"description": "The other cutest Discord client mod", "description": "The other cutest Discord client mod",
"homepage": "https://github.com/Equicord/Equicord#readme", "homepage": "https://github.com/Equicord/Equicord#readme",
"bugs": { "bugs": {
@ -119,4 +119,4 @@
"engines": { "engines": {
"node": ">=18" "node": ">=18"
} }
} }

View file

@ -93,11 +93,6 @@ async function initThemes() {
document.addEventListener("DOMContentLoaded", () => { document.addEventListener("DOMContentLoaded", () => {
initSystemValues(); initSystemValues();
if (!IS_WEB) {
VencordNative.quickCss.addThemeChangeListener(initThemes);
}
initThemes(); initThemes();
toggle(Settings.useQuickCss); toggle(Settings.useQuickCss);
@ -105,6 +100,10 @@ document.addEventListener("DOMContentLoaded", () => {
SettingsStore.addChangeListener("enabledThemeLinks", initThemes); SettingsStore.addChangeListener("enabledThemeLinks", initThemes);
SettingsStore.addChangeListener("enabledThemes", initThemes); SettingsStore.addChangeListener("enabledThemes", initThemes);
if (!IS_WEB) {
VencordNative.quickCss.addThemeChangeListener(initThemes);
}
}); });
export function initQuickCssThemeStore() { export function initQuickCssThemeStore() {

View file

@ -105,7 +105,11 @@ define(Function.prototype, "m", {
} }
const fileName = stack.match(/\/assets\/(.+?\.js)/)?.[1]; const fileName = stack.match(/\/assets\/(.+?\.js)/)?.[1];
if (fileName?.includes("libdiscore")) {
// Currently, sentry and libDiscore Webpack instances are not meant to be patched.
// As an extra measure, take advatange of the fact their files include the names and return early if it's one of them.
// Later down we also include other measures to avoid patching them.
if (["sentry", "libdiscore"].some(name => fileName?.toLowerCase()?.includes(name))) {
return; return;
} }
@ -119,7 +123,10 @@ define(Function.prototype, "m", {
define(this, "p", { value: bundlePath }); define(this, "p", { value: bundlePath });
clearTimeout(bundlePathTimeout); clearTimeout(bundlePathTimeout);
if (bundlePath !== "/assets/") { // libDiscore init Webpack instance always returns a constanst string for the js filename of a chunk.
// In that case, avoid patching this instance,
// as it runs before the main Webpack instance and will make the WebpackRequire fallback not work properly, or init an wrongful main WebpackRequire.
if (bundlePath !== "/assets/" || /(?:=>|{return)"[^"]/.exec(String(this.u))) {
return; return;
} }
@ -132,9 +139,9 @@ define(Function.prototype, "m", {
} }
}); });
// In the past, the sentry Webpack instance which we also wanted to patch used to rely on chunks being loaded before initting sentry. // In the past, the sentry Webpack instance which we also wanted to patch used to rely on chunks being loaded before initing sentry.
// This Webpack instance did not include actual chunk loading, and only awaited for them to be loaded, which means it did not include the bundlePath property. // This Webpack instance did not include actual chunk loading, and only awaited for them to be loaded, which means it did not include the bundlePath property.
// To keep backwards compability, in case this is ever the case again, and keep patching this type of instance, we explicity patch instances which include wreq.O and not wreq.p. // To keep backwards compability, if this is ever the case again, and keep patching this type of instance, we explicity patch instances which include wreq.O and not wreq.p.
// Since we cannot check what is the bundlePath of the instance to filter for the Discord bundlePath, we only patch it if wreq.p is not included, // Since we cannot check what is the bundlePath of the instance to filter for the Discord bundlePath, we only patch it if wreq.p is not included,
// which means the instance relies on another instance which does chunk loading, and that makes it very likely to only target Discord Webpack instances like the old sentry. // which means the instance relies on another instance which does chunk loading, and that makes it very likely to only target Discord Webpack instances like the old sentry.