Fix public servers and media keys

This commit is contained in:
Zack Rauen 2022-01-24 00:15:55 -05:00
parent 8176425039
commit 6f167ab2cd
4 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# BetterDiscord [![Language Grade][lgtm-badge]][lgtm-link] ![GitHub Releases][downloads-badge] [![Patreon][patreon-badge]][patreon-link] [![Paypal][paypal-badge]][paypal-link]
# BetterDiscord [![Language Grade][lgtm-badge]][lgtm-link] ![GitHub Releases][downloads-badge]
[patreon-badge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3DZerebos%26type%3Dpatrons&style=flat-square
[patreon-link]: https://patreon.com/Zerebos

View File

@ -31,3 +31,8 @@ if (process.platform == "win32" || process.platform == "darwin") {
Module._load(path.join(basePath, pkg.main), null, true);
}
// Needs to run this after Discord but before ready()
if (!process.argv.includes("--vanilla")) {
const BetterDiscord = require("./modules/betterdiscord").default;
BetterDiscord.disableMediaKeys();
}

View File

@ -111,6 +111,12 @@ export default class BetterDiscord {
hasCrashed = true;
});
}
static disableMediaKeys() {
if (!BetterDiscord.getSetting("general", "mediaKeys")) return;
const originalDisable = electron.app.commandLine.getSwitchValue("disable-features") || "";
electron.app.commandLine.appendSwitch("disable-features", `${originalDisable ? "," : ""}HardwareMediaKeyHandling,MediaSessionService`);
}
}
if (BetterDiscord.getSetting("developer", "reactDevTools")) {
@ -118,7 +124,3 @@ if (BetterDiscord.getSetting("developer", "reactDevTools")) {
await ReactDevTools.install();
});
}
if (BetterDiscord.getSetting("general", "mediaKeys")) {
electron.app.commandLine.appendSwitch("disable-features", "HardwareMediaKeyHandling,MediaSessionService");
}

View File

@ -149,8 +149,8 @@ export default Utilities.memoizeObject({
const guildsWrapper = WebpackModules.getByProps("base", "guilds");
const guilds = WebpackModules.getByProps("wrapper", "acronym");
const pill = WebpackModules.getByProps("circleIconButton");
const listItem = WebpackModules.getModule(m => m.listItem && !m.pill);
return Object.assign({}, guildsWrapper, listItem, guilds, pill);
const listItem = WebpackModules.getModule(m => m.listItem && !m.pill && !m.sidebar);
return Object.assign({}, guildsWrapper, guilds, pill, listItem);
},
get LayerStack() {return WebpackModules.getByProps("pushLayer");}