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:
parent
b7696b04bf
commit
433ffd3388
@ -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"));
|
||||||
|
Loading…
Reference in New Issue
Block a user