mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 16:44:43 +01:00
Update download.ts
This commit is contained in:
@@ -77,17 +77,20 @@ export default class DownloadHandler {
|
|||||||
|
|
||||||
// Extraction events
|
// Extraction events
|
||||||
listen('extract_start', ({ payload }) => {
|
listen('extract_start', ({ payload }) => {
|
||||||
// Find the download that is no extracting and set it's status as such
|
// Find the download that is extracting and set it's status as such
|
||||||
// @ts-expect-error Too lazy to make an interface for payloads rn
|
const index = this.downloads.findIndex((download) => download.path === payload)
|
||||||
const index = this.downloads.findIndex((download) => download.path === payload.file)
|
|
||||||
this.downloads[index].status = 'extracting'
|
this.downloads[index].status = 'extracting'
|
||||||
})
|
})
|
||||||
|
|
||||||
listen('extract_end', ({ payload }) => {
|
listen('extract_end', ({ payload }) => {
|
||||||
console.log(payload)
|
// @ts-expect-error shut up typescript
|
||||||
// Find the download that is no extracting and set it's status as such
|
const obj: {
|
||||||
// @ts-expect-error Too lazy to make an interface for payloads rn
|
file: string
|
||||||
const index = this.downloads.findIndex((download) => download.path === payload.file)
|
new_folder: string
|
||||||
|
} = payload
|
||||||
|
|
||||||
|
// Find the download that is not extracting and set it's status as such
|
||||||
|
const index = this.downloads.findIndex((download) => download.path === obj.file || obj.new_folder)
|
||||||
this.downloads[index].status = 'finished'
|
this.downloads[index].status = 'finished'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user