Shazbot / WH3-Mod-Manager

Mod manager for Total War: Warhammer 3, Steam version only
MIT License
107 stars 17 forks source link

Error when `Load Mods From Save` if using `swc-loader` #13

Open atp-tha opened 1 year ago

atp-tha commented 1 year ago

Copied from #12 , to keep track of the problem.

Actually found an issues where this breaks something: I noticed this breaks Load Mods From Save where we load mod names from a save (located using the green arrow next to continue).

With ts-loader we send mainWindow.webContents.send("packsInSave", await getPacksInSave(saveName)); where we send a string[] of mod pack names and we then receive string[] in renderer.ts

window.api.packsInSave((event, packNames: string[]) => {
  console.log("packs in save: ", packNames);
  store.dispatch(enableModsByName(packNames));
});

with swc-loader in the renderer we receive packNames as a string instead of string[] and it seems to be the value of packNames[0]

Originally posted by @Shazbot in https://github.com/Shazbot/WH3-Mod-Manager/issues/12#issuecomment-1257196357