diff --git a/package-lock.json b/package-lock.json index 2336ba2..00b4af7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "arduino-create-agent-js-client", - "version": "2.4.6", + "version": "2.4.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 779e00d..c5f3f9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arduino-create-agent-js-client", - "version": "2.4.6", + "version": "2.4.7", "description": "JS module providing discovery of the Arduino Create Plugin and communication with it", "main": "lib/index.js", "module": "es/index.js", diff --git a/src/firmware-updater.js b/src/firmware-updater.js index c359b56..9b16442 100644 --- a/src/firmware-updater.js +++ b/src/firmware-updater.js @@ -91,15 +91,15 @@ export default class FirmwareUpdater { if (!this.firmwareVersionData) { this.updating.next({ status: this.updateStatusEnum.ERROR, err: `Can't get firmware info: couldn't find version '${firmwareVersion}' for board '${boardId}'` }); } + else { + firmwareInfoMessagesSubscription.unsubscribe(); + this.updating.next({ status: this.updateStatusEnum.GOT_INFO }); + } break; case 'Error': this.updating.next({ status: this.updateStatusEnum.ERROR, err: `Couldn't get firmware info: ${message.Msg}` }); firmwareInfoMessagesSubscription.unsubscribe(); break; - case 'Done': - firmwareInfoMessagesSubscription.unsubscribe(); - this.updating.next({ status: this.updateStatusEnum.GOT_INFO }); - break; default: break; }