Skip to content

Commit

Permalink
Change fw updater success condition (#493)
Browse files Browse the repository at this point in the history
* change fw updater success condition

* 2.4.8
  • Loading branch information
Alberto Iannaccone authored Apr 28, 2021
1 parent 2f0e02f commit 510b5de
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arduino-create-agent-js-client",
"version": "2.4.7",
"version": "2.4.8",
"description": "JS module providing discovery of the Arduino Create Plugin and communication with it",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
10 changes: 6 additions & 4 deletions src/firmware-updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,16 @@ export default class FirmwareUpdater {

const handleFirmwareUpdateMessage = message => {
switch (message.ProgrammerStatus) {
case 'Busy':
if (message.Msg.indexOf('Operation completed: success! :-)') >= 0) {
this.updating.next({ status: this.updateStatusEnum.DONE });
updateFirmwareMessagesSubscription.unsubscribe();
}
break;
case 'Error':
this.updating.next({ status: this.updateStatusEnum.ERROR, err: `Can't update Firmware: ${message.Msg}` });
updateFirmwareMessagesSubscription.unsubscribe();
break;
case 'Done':
this.updating.next({ status: this.updateStatusEnum.DONE });
updateFirmwareMessagesSubscription.unsubscribe();
break;
default:
break;
}
Expand Down

0 comments on commit 510b5de

Please sign in to comment.