From 2f0e02f00fe3bf791d4c09e12b86469ebd72ab41 Mon Sep 17 00:00:00 2001 From: Alberto Iannaccone Date: Tue, 27 Apr 2021 18:03:10 +0200 Subject: [PATCH] Fix firmware info (#492) * fix get firmware info * 2.4.7 --- package-lock.json | 2 +- package.json | 2 +- src/firmware-updater.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) 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; }