mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
handle rar files, add back button svg
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -49,13 +49,9 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
modEnabled: await modIsEnabled(this.props.mod.name),
|
||||
})
|
||||
|
||||
console.log(this.props.mod.name + ' ' + this.state.modEnabled)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
console.log(this.props.mod.name + ' ' + this.state.modEnabled)
|
||||
|
||||
this.setState({
|
||||
modEnabled: await modIsEnabled(String(this.props.mod.id)),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user