From 0c67c597f0854f65dfa082f8590b9f618beb0515 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:25:18 -0400 Subject: [PATCH] Updates --- src/Vencord.ts | 12 +++++++----- src/VencordNative.ts | 2 +- src/webpack/patchWebpack.ts | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Vencord.ts b/src/Vencord.ts index 2f7da348..1fc33cb6 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -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 }); diff --git a/src/VencordNative.ts b/src/VencordNative.ts index b8f7019d..43b0b0bd 100644 --- a/src/VencordNative.ts +++ b/src/VencordNative.ts @@ -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(event: IpcEvents, ...args: any[]) { return ipcRenderer.invoke(event, ...args) as Promise; diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index b0ba6563..f32aeb78 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -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,