Skip to content

Commit

Permalink
Merge pull request #243 from FoamyGuy/beta_dupe_serial_fix
Browse files Browse the repository at this point in the history
Fix duplicate serial console messages
  • Loading branch information
makermelissa authored Aug 28, 2024
2 parents eddc427 + 4ed7133 commit aeb886c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/workflows/usb.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class USBWorkflow extends Workflow {
this._partialToken = null;
this._uid = null;
this._readLoopPromise = null;
this._messageCallback = null;
this._btnSelectHostFolderCallback = null;
this._btnUseHostFolderCallback = null;

}

async init(params) {
Expand Down Expand Up @@ -245,8 +245,10 @@ class USBWorkflow extends Workflow {

// Workflow specific Functions
async _switchToDevice(device) {
device.removeEventListener("message", this.onSerialReceive.bind(this));
device.addEventListener("message", this.onSerialReceive.bind(this));

device.removeEventListener("message", this._messageCallback);
this._messageCallback = this.onSerialReceive.bind(this);
device.addEventListener("message", this._messageCallback);

let onDisconnect = async (e) => {
await this.onDisconnected(e, false);
Expand Down

0 comments on commit aeb886c

Please sign in to comment.