diff options
author | V <vendicated@riseup.net> | 2023-05-02 02:50:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 02:50:51 +0200 |
commit | c62d05e1b32361425474928004a92338d98ba200 (patch) | |
tree | 63e2d718807055dbdbbe7d2624270d8aa138fa2d /src/preload.ts | |
parent | 6a1cb133cd6cbe2946e4c830291318e873da1d8b (diff) | |
download | Vencord-c62d05e1b32361425474928004a92338d98ba200.tar.gz Vencord-c62d05e1b32361425474928004a92338d98ba200.tar.bz2 Vencord-c62d05e1b32361425474928004a92338d98ba200.zip |
Refactor ipc to be strongly typed and hide impl details (#1018)
Diffstat (limited to 'src/preload.ts')
-rw-r--r-- | src/preload.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/preload.ts b/src/preload.ts index 276cceb..5f6c445 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -17,7 +17,6 @@ */ import { debounce } from "@utils/debounce"; -import IpcEvents from "@utils/IpcEvents"; import { contextBridge, webFrame } from "electron"; import { readFileSync, watch } from "fs"; import { join } from "path"; @@ -58,8 +57,8 @@ if (location.protocol !== "data:") { } } // Monaco popout else { - contextBridge.exposeInMainWorld("setCss", debounce(s => VencordNative.ipc.invoke(IpcEvents.SET_QUICK_CSS, s))); - contextBridge.exposeInMainWorld("getCurrentCss", () => VencordNative.ipc.invoke(IpcEvents.GET_QUICK_CSS)); + contextBridge.exposeInMainWorld("setCss", debounce(VencordNative.quickCss.set)); + contextBridge.exposeInMainWorld("getCurrentCss", VencordNative.quickCss.get); // shrug contextBridge.exposeInMainWorld("getTheme", () => "vs-dark"); } |