ConsoleShortcuts: Fix autocomplete on lazies, add more utils (#2519)

This commit is contained in:
vee 2024-05-28 22:31:58 +02:00 committed by GitHub
parent b9e83d9d28
commit a78dba321d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 192 additions and 113 deletions

View file

@ -0,0 +1,16 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { IpcMainInvokeEvent } from "electron";
export function initDevtoolsOpenEagerLoad(e: IpcMainInvokeEvent) {
const handleDevtoolsOpened = () => e.sender.executeJavaScript("Vencord.Plugins.plugins.ConsoleShortcuts.eagerLoad(true)");
if (e.sender.isDevToolsOpened())
handleDevtoolsOpened();
else
e.sender.once("devtools-opened", () => handleDevtoolsOpened());
}