diff options
author | Vendicated <vendicated@riseup.net> | 2023-01-24 13:50:02 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2023-01-24 13:50:02 +0100 |
commit | a38ac956dfaf53711a4cddea73ae1b8cf617211a (patch) | |
tree | 7f64e081ddcfd0c1d289e1390e02ac29d593ad2f /src/preload.ts | |
parent | 34276301c31dc1b464d79a07e25a347968e78313 (diff) | |
download | Vencord-a38ac956dfaf53711a4cddea73ae1b8cf617211a.tar.gz Vencord-a38ac956dfaf53711a4cddea73ae1b8cf617211a.tar.bz2 Vencord-a38ac956dfaf53711a4cddea73ae1b8cf617211a.zip |
chore: Remove legacy workarounds
Diffstat (limited to 'src/preload.ts')
-rw-r--r-- | src/preload.ts | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/src/preload.ts b/src/preload.ts index 3867f33..820b655 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -18,7 +18,7 @@ import { debounce } from "@utils/debounce"; import IpcEvents from "@utils/IpcEvents"; -import { contextBridge, ipcRenderer, webFrame } from "electron"; +import { contextBridge, webFrame } from "electron"; import { readFileSync, watch } from "fs"; import { join } from "path"; @@ -45,24 +45,14 @@ if (location.protocol !== "data:") { } } - try { - const css = readFileSync(rendererCss, "utf-8"); - insertCss(css); - if (IS_DEV) { - // persistent means keep process running if watcher is the only thing still running - // which we obviously don't want - watch(rendererCss, { persistent: false }, () => { - document.getElementById("vencord-css-core")!.textContent = readFileSync(rendererCss, "utf-8"); - }); - } - } catch (err) { - if ((err as NodeJS.ErrnoException)?.code !== "ENOENT") - throw err; - - // hack: the pre update updater does not download this file, so manually download it - // TODO: remove this in a future version - ipcRenderer.invoke(IpcEvents.DOWNLOAD_VENCORD_CSS) - .then(insertCss); + const css = readFileSync(rendererCss, "utf-8"); + insertCss(css); + if (IS_DEV) { + // persistent means keep process running if watcher is the only thing still running + // which we obviously don't want + watch(rendererCss, { persistent: false }, () => { + document.getElementById("vencord-css-core")!.textContent = readFileSync(rendererCss, "utf-8"); + }); } require(process.env.DISCORD_PRELOAD!); } else { |