Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #115 from leaphy-robotics/upload-bug
Browse files Browse the repository at this point in the history
fix: bug with uploader
  • Loading branch information
koen1711 authored Jan 26, 2024
2 parents b57ddfe + 4b44783 commit e3e40b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"productName": "Leaphy Webbased",
"author": "Leaphy Robotics",
"description": "Build Leaphy Arduino programs",
"version": "2.0.3",
"version": "2.0.4",
"license": "GPLv3",
"main": "src/main.ts",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/app/services/arduino-uploader/ArduinoUploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ class Arduino {
* @param callback A callback function to call when the upload status changes.
*/
async upload(program: string, callback = (message: string) => {}) {
if (this.robotWiredState.getAbortController() != null) {
this.robotWiredState.getAbortController().abort("Upload started");
this.robotWiredState.setAbortController(null);
await delay(1000);
}

if (this.isUploading)
throw new Error('Arduino is already uploading')
this.robotWiredState.clearUploadLog()
Expand Down

0 comments on commit e3e40b2

Please sign in to comment.