Skip to content

Commit

Permalink
Hotfix, was just an issue with adding strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ipmake committed Apr 11, 2023
1 parent 72b9e05 commit c40f64f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "knockoutcitylauncher",
"description": "Unofficial Knockout City Launcher",
"version": "0.1.3",
"version": "0.1.4",
"private": true,
"homepage": "./",
"main": "public/electron.js",
Expand Down
5 changes: 3 additions & 2 deletions public/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ function createWindow () {
});

res.on('data', (chunk) => {
win.webContents.executeJavaScript(`window.postMessage({type: "download-progress", data: ${roundToDecimalPlace(((fileSize + writeStream.bytesWritten) / (res.headers['content-length'] + fileSize)) * 100, 2)}})`)
win.setProgressBar((fileSize + writeStream.bytesWritten) / (res.headers['content-length'] + fileSize))
console.log((fileSize + writeStream.bytesWritten) / (parseFloat(res.headers['content-length']) + fileSize))
win.webContents.executeJavaScript(`window.postMessage({type: "download-progress", data: ${roundToDecimalPlace(((fileSize + writeStream.bytesWritten) / (parseFloat(res.headers['content-length']) + fileSize)) * 100, 2)}})`)
win.setProgressBar((fileSize + writeStream.bytesWritten) / (parseFloat(res.headers['content-length']) + fileSize))
});

ipcMain.once('cancel-download', async (event, arg) => {
Expand Down

0 comments on commit c40f64f

Please sign in to comment.