Turn IpcEvents into a const enum

This commit is contained in:
Vendicated
2023-04-09 01:22:31 +02:00
parent 8f19d41d4c
commit 591d380160
4 changed files with 30 additions and 27 deletions
+4 -4
View File
@@ -1,10 +1,10 @@
import { contextBridge, ipcRenderer, webFrame } from "electron";
import { GET_RENDERER_SCRIPT, GET_RENDERER_STYLES, GET_VENCORD_PRELOAD_FILE } from "../shared/IpcEvents";
import { IpcEvents } from "../shared/IpcEvents";
import { VencordDesktopNative } from "./VencordDesktopNative";
contextBridge.exposeInMainWorld("VencordDesktopNative", VencordDesktopNative);
require(ipcRenderer.sendSync(GET_VENCORD_PRELOAD_FILE));
require(ipcRenderer.sendSync(IpcEvents.GET_VENCORD_PRELOAD_FILE));
webFrame.executeJavaScript(ipcRenderer.sendSync(GET_RENDERER_SCRIPT));
ipcRenderer.invoke(GET_RENDERER_STYLES).then(s => webFrame.insertCSS(s));
webFrame.executeJavaScript(ipcRenderer.sendSync(IpcEvents.GET_RENDERER_SCRIPT));
ipcRenderer.invoke(IpcEvents.GET_RENDERER_STYLES).then(s => webFrame.insertCSS(s));