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

@@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
<desc>Created with Fabric.js 1.7.22</desc>
<defs>
</defs>
<g transform="translate(128 128) scale(0.72 0.72)" style="">
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(-175.05 -175.05) scale(3.89 3.89)" >
<path d="M 45 0 c 24.813 0 45 20.187 45 45 c 0 24.813 -20.187 45 -45 45 C 20.186 90 0 69.813 0 45 C 0 20.187 20.186 0 45 0 z M 51.263 73.4 l 8.6 -8.6 L 40.064 45 l 19.799 -19.799 l -8.6 -8.6 L 22.864 45 L 51.263 73.4 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1002 B

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)

View File

@@ -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)),
})