Fix public servers and media keys
This commit is contained in:
parent
8176425039
commit
6f167ab2cd
|
@ -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-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
|
[patreon-link]: https://patreon.com/Zerebos
|
||||||
|
|
|
@ -31,3 +31,8 @@ if (process.platform == "win32" || process.platform == "darwin") {
|
||||||
Module._load(path.join(basePath, pkg.main), null, true);
|
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();
|
||||||
|
}
|
|
@ -111,6 +111,12 @@ export default class BetterDiscord {
|
||||||
hasCrashed = true;
|
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")) {
|
if (BetterDiscord.getSetting("developer", "reactDevTools")) {
|
||||||
|
@ -118,7 +124,3 @@ if (BetterDiscord.getSetting("developer", "reactDevTools")) {
|
||||||
await ReactDevTools.install();
|
await ReactDevTools.install();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BetterDiscord.getSetting("general", "mediaKeys")) {
|
|
||||||
electron.app.commandLine.appendSwitch("disable-features", "HardwareMediaKeyHandling,MediaSessionService");
|
|
||||||
}
|
|
||||||
|
|
|
@ -149,8 +149,8 @@ export default Utilities.memoizeObject({
|
||||||
const guildsWrapper = WebpackModules.getByProps("base", "guilds");
|
const guildsWrapper = WebpackModules.getByProps("base", "guilds");
|
||||||
const guilds = WebpackModules.getByProps("wrapper", "acronym");
|
const guilds = WebpackModules.getByProps("wrapper", "acronym");
|
||||||
const pill = WebpackModules.getByProps("circleIconButton");
|
const pill = WebpackModules.getByProps("circleIconButton");
|
||||||
const listItem = WebpackModules.getModule(m => m.listItem && !m.pill);
|
const listItem = WebpackModules.getModule(m => m.listItem && !m.pill && !m.sidebar);
|
||||||
return Object.assign({}, guildsWrapper, listItem, guilds, pill);
|
return Object.assign({}, guildsWrapper, guilds, pill, listItem);
|
||||||
},
|
},
|
||||||
|
|
||||||
get LayerStack() {return WebpackModules.getByProps("pushLayer");}
|
get LayerStack() {return WebpackModules.getByProps("pushLayer");}
|
||||||
|
|
Loading…
Reference in New Issue