1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Fixed fs-job for modloader

This commit is contained in:
DJ1TJOO 2021-03-14 16:27:16 +01:00
parent b7696b04bf
commit 433ffd3388

View File

@ -84,17 +84,20 @@ window.onload = async () => {
let instance = undefined; let instance = undefined;
let modFolderContents = []; let modFolderContents = [];
if (G_IS_STANDALONE) { if (G_IS_STANDALONE) {
modFolderContents = getIPCRenderer().sendSync("fs-sync-job", { const dirResult = await getIPCRenderer().invoke("fs-job", {
folder: "mods", folder: "mods",
type: "readDir", type: "readDir",
filename: "", filename: "",
}).data; });
if (dirResult.success) modFolderContents = dirResult.data;
if (modFolderContents.includes("modpack.json")) { if (modFolderContents.includes("modpack.json")) {
instance = getIPCRenderer().sendSync("fs-sync-job", { const instanceResult = await getIPCRenderer().invoke("fs-job", {
folder: "mods", folder: "mods",
type: "read", type: "read",
filename: "modpack.json", filename: "modpack.json",
}); });
if (instanceResult.success) instance = JSON.parse(instanceResult.data);
} }
} else if (!G_IS_DEV) { } else if (!G_IS_DEV) {
user = JSON.parse(localStorage.getItem("user")); user = JSON.parse(localStorage.getItem("user"));