Fix ModPackView and add 2.0 scenario support

This commit is contained in:
Cooldude2606 committed 2024-11-13 19:11:59 +00:00
1 parent c714d86c5c
commit 81444cc447
5 files changed
+46 -26

No files matched your search

+5 -4
View File
@@ -96,10 +96,11 @@ function CreateModPackButton() {
} catch {
return; // Validation failed
}
const modPack = lib.ModPack.fromJSON({} as any);
modPack.name = values.name;
modPack.factorioVersion = values.factorioVersion;
if (values.description) { modPack.description = values.description; }
const modPack = lib.ModPack.fromJSON({
name: values.name,
description: values.description,
factorio_version: values.factorioVersion,
} as any);
await control.send(new lib.ModPackCreateRequest(modPack));
navigate(`/mods/mod-packs/${modPack.id}/view`);
})().catch(notifyErrorHandler("Error creating mod pack"));