mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 22:23:02 -04:00
Refactor ipc to be strongly typed and hide impl details (#1018)
This commit is contained in:
parent
6a1cb133cd
commit
c62d05e1b3
21 changed files with 158 additions and 218 deletions
|
@ -18,7 +18,6 @@
|
|||
|
||||
import { addSettingsListener, Settings } from "@api/settings";
|
||||
|
||||
import IpcEvents from "./IpcEvents";
|
||||
|
||||
let style: HTMLStyleElement;
|
||||
let themesStyle: HTMLStyleElement;
|
||||
|
@ -29,8 +28,8 @@ export async function toggle(isEnabled: boolean) {
|
|||
style = document.createElement("style");
|
||||
style.id = "vencord-custom-css";
|
||||
document.head.appendChild(style);
|
||||
VencordNative.ipc.on(IpcEvents.QUICK_CSS_UPDATE, (_, css: string) => style.textContent = css);
|
||||
style.textContent = await VencordNative.ipc.invoke(IpcEvents.GET_QUICK_CSS);
|
||||
VencordNative.quickCss.addChangeListener(css => style.textContent = css);
|
||||
style.textContent = await VencordNative.quickCss.get();
|
||||
}
|
||||
} else
|
||||
style.disabled = !isEnabled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue