vecord: download proper vesktop specific preload & renderer css (#90)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Justice Almanzar 2023-08-12 01:09:14 +00:00 committed by GitHub
parent 9003b94f85
commit 6dc26aea6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View file

@ -17,9 +17,10 @@ import { autoStart } from "./autoStart";
import { VENCORD_FILES_DIR, VENCORD_QUICKCSS_FILE, VENCORD_THEMES_DIR } from "./constants";
import { mainWin } from "./mainWindow";
import { Settings } from "./settings";
import { FILES_TO_DOWNLOAD } from "./utils/vencordLoader";
ipcMain.on(IpcEvents.GET_VENCORD_PRELOAD_FILE, e => {
e.returnValue = join(VENCORD_FILES_DIR, "preload.js");
e.returnValue = join(VENCORD_FILES_DIR, "vencordDesktopPreload.js");
});
ipcMain.on(IpcEvents.GET_VENCORD_RENDERER_SCRIPT, e => {
@ -111,7 +112,7 @@ ipcMain.handle(IpcEvents.SELECT_VENCORD_DIR, async () => {
if (!res.filePaths.length) return "cancelled";
const dir = res.filePaths[0];
for (const file of ["vencordDesktopMain.js", "preload.js", "vencordDesktopRenderer.js", "renderer.css"]) {
for (const file of FILES_TO_DOWNLOAD) {
if (!existsSync(join(dir, file))) return "invalid";
}

View file

@ -13,7 +13,12 @@ import { downloadFile, simpleGet } from "./http";
const API_BASE = "https://api.github.com";
const FILES_TO_DOWNLOAD = ["vencordDesktopMain.js", "preload.js", "vencordDesktopRenderer.js", "renderer.css"];
export const FILES_TO_DOWNLOAD = [
"vencordDesktopMain.js",
"vencordDesktopPreload.js",
"vencordDesktopRenderer.js",
"vencordDesktopRenderer.css"
];
export interface ReleaseData {
name: string;