Skip to content

Commit dcb2a1e

Browse files
committed
Remove UPLOAD_DONE_TIMER
Squashed commit of the following: commit 63cdfa40ce77973afeca9b780df15d78e6d4993e Author: pirropirro <fra.pirrotta@gmail.com> Date: Mon Mar 4 11:28:36 2024 +0100 Bump version commit 2d4e6a1a94cadd46c9472db9ca32458b8eb9e9d7 Author: pirropirro <fra.pirrotta@gmail.com> Date: Mon Mar 4 10:44:43 2024 +0100 Remove `UPLOAD_DONE_TIMER`
1 parent 7bbe944 commit dcb2a1e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arduino-create-agent-js-client",
3-
"version": "2.13.0",
3+
"version": "2.14.0",
44
"description": "JS module providing discovery of the Arduino Create Plugin and communication with it",
55
"main": "lib/index.js",
66
"module": "es/index.js",

‎src/socket-daemon.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import V2 from './socket-daemon.v2';
3131
// Required agent version
3232
const browser = detect();
3333
const POLLING_INTERVAL = 3500;
34-
const UPLOAD_DONE_TIMER = 5000;
3534

3635
const PROTOCOL = {
3736
HTTP: 'http',
@@ -383,10 +382,8 @@ export default class SocketDaemon extends Daemon {
383382
}
384383

385384
handleUploadMessage(message) {
386-
if (message.Flash === 'Ok' && message.ProgrammerStatus === 'Done') {
387-
// After the upload is completed the port goes down for a while, so we have to wait a few seconds
388-
return timer(UPLOAD_DONE_TIMER).subscribe(() => this.uploading.next({ status: this.UPLOAD_DONE, msg: message.Flash }));
389-
}
385+
if (message.Flash === 'Ok' && message.ProgrammerStatus === 'Done') return this.uploading.next({ status: this.UPLOAD_DONE, msg: message.Flash });
386+
390387
switch (message.ProgrammerStatus) {
391388
case 'Starting':
392389
this.uploading.next({ status: this.UPLOAD_IN_PROGRESS, msg: `Programming with: ${message.Cmd}` });

0 commit comments

Comments
 (0)