demo progress report fix

This commit is contained in:
Eugene Pankov 2021-07-29 21:07:31 +02:00
parent 61ea2c77c8
commit 87007d5ae3
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -64,7 +64,7 @@ export class Session extends BaseSession {
}, 2000)
})
this.vm.add_listener('download-progress', (e) => {
this.emitMessage(`\rDownloading ${path.basename(e.file_name)}: ${e.loaded / 1024}/${e.total / 1024} kB `)
this.emitMessage(`\rDownloading ${path.basename(e.file_name)}: ${Math.floor(e.loaded / 1024)}/${Math.floor(e.total / 1024)} kB `)
})
this.vm.add_listener('download-error', (e) => {
this.emitMessage(`\r\nDownload error: ${e}\r\n`)