This commit is contained in:
thororen1234 2024-07-10 15:25:18 -04:00
parent 102851558d
commit 0c67c597f0
3 changed files with 8 additions and 7 deletions

View file

@ -87,7 +87,6 @@ async function syncSettings() {
async function init() {
await onceReady;
startAllPlugins(StartAt.WebpackReady);
syncSettings();
@ -136,13 +135,16 @@ async function init() {
}
}
startAllPlugins(StartAt.Init);
init();
if (IS_DISCORD_DESKTOP && Settings.winNativeTitleBar && navigator.platform.toLowerCase().startsWith("win")) {
document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("DOMContentLoaded", () => {
startAllPlugins(StartAt.DOMContentLoaded);
if (IS_DISCORD_DESKTOP && Settings.winNativeTitleBar && navigator.platform.toLowerCase().startsWith("win")) {
document.head.append(Object.assign(document.createElement("style"), {
id: "vencord-native-titlebar-style",
textContent: "[class*=titleBar]{display: none!important}"
}));
}, { once: true });
}
}
}, { once: true });

View file

@ -4,11 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { PluginIpcMappings } from "@main/ipcPlugins";
import { IpcEvents } from "@shared/IpcEvents";
import { IpcRes } from "@utils/types";
import type { Settings } from "api/Settings";
import { ipcRenderer } from "electron";
import { PluginIpcMappings } from "main/ipcPlugins";
function invoke<T = any>(event: IpcEvents, ...args: any[]) {
return ipcRenderer.invoke(event, ...args) as Promise<T>;

View file

@ -128,7 +128,6 @@ function patchPush(webpackGlobal: any) {
// being applied multiple times.
// Thus, override bind to use the original push
handlePush.bind = (...args: unknown[]) => handlePush.$$vencordOriginal.bind(...args);
handlePush.toString = handlePush.$$vencordOriginal.toString.bind(handlePush.$$vencordOriginal);
Object.defineProperty(webpackGlobal, "push", {
configurable: true,