diff options
Diffstat (limited to 'src/ipcMain')
-rw-r--r-- | src/ipcMain/index.ts | 1 | ||||
-rw-r--r-- | src/ipcMain/legacy.ts | 31 | ||||
-rw-r--r-- | src/ipcMain/updater/common.ts | 2 | ||||
-rw-r--r-- | src/ipcMain/updater/http.ts | 2 |
4 files changed, 34 insertions, 2 deletions
diff --git a/src/ipcMain/index.ts b/src/ipcMain/index.ts index 86a233c..ae8a96d 100644 --- a/src/ipcMain/index.ts +++ b/src/ipcMain/index.ts @@ -16,6 +16,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import "./legacy"; import "./updater"; import { debounce } from "@utils/debounce"; diff --git a/src/ipcMain/legacy.ts b/src/ipcMain/legacy.ts new file mode 100644 index 0000000..567ad3d --- /dev/null +++ b/src/ipcMain/legacy.ts @@ -0,0 +1,31 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +import IpcEvents from "@utils/IpcEvents"; +import { ipcMain } from "electron"; +import { writeFile } from "fs/promises"; +import { join } from "path"; + +import { get } from "./simpleGet"; + +ipcMain.handleOnce(IpcEvents.DOWNLOAD_VENCORD_CSS, async () => { + const buf = await get("https://github.com/Vendicated/Vencord/releases/download/devbuild/renderer.css"); + await writeFile(join(__dirname, "renderer.css"), buf); + return buf.toString("utf-8"); +}); + diff --git a/src/ipcMain/updater/common.ts b/src/ipcMain/updater/common.ts index 41f08e8..3729c6d 100644 --- a/src/ipcMain/updater/common.ts +++ b/src/ipcMain/updater/common.ts @@ -24,7 +24,7 @@ export async function calculateHashes() { const hashes = {} as Record<string, string>; await Promise.all( - ["patcher.js", "preload.js", "renderer.js"].map(file => new Promise<void>(r => { + ["patcher.js", "preload.js", "renderer.js", "renderer.css"].map(file => new Promise<void>(r => { const fis = createReadStream(join(__dirname, file)); const hash = createHash("sha1", { encoding: "hex" }); fis.once("end", () => { diff --git a/src/ipcMain/updater/http.ts b/src/ipcMain/updater/http.ts index 902d644..3b38144 100644 --- a/src/ipcMain/updater/http.ts +++ b/src/ipcMain/updater/http.ts @@ -69,7 +69,7 @@ async function fetchUpdates() { return false; data.assets.forEach(({ name, browser_download_url }) => { - if (["patcher.js", "preload.js", "renderer.js"].some(s => name.startsWith(s))) { + if (["patcher.js", "preload.js", "renderer.js", "renderer.css"].some(s => name.startsWith(s))) { PendingUpdates.push([name, browser_download_url]); } }); |