handle rar files, add back button svg

This commit is contained in:
SpikeHD
2022-07-25 22:09:24 -07:00
parent 2026e2f896
commit cffbcdae96
6 changed files with 252 additions and 36 deletions

View File

@@ -56,13 +56,15 @@ export class Mods extends React.Component<IProps, IState> {
async addDownload(mod: ModData) {
const modFolder = await getModsFolder()
const modPath = `${modFolder}${mod.id}.zip`
const dlLinks = await getModDownload(String(mod.id))
if (!modFolder || dlLinks.length === 0) return
// Not gonna bother allowing sorting for now
const firstLink = dlLinks[0].downloadUrl
const fileExt = firstLink.split('.').pop()
const modPath = `${modFolder}${mod.id}.${fileExt}`
if (!modFolder || dlLinks.length === 0) return
this.props.downloadHandler.addDownload(firstLink, modPath, async () => {
const unzipRes = await unzip(modPath, modFolder, false, true)