Skip to content

Commit

Permalink
Merge pull request #32 from particle-iot/fix-receive-event/sc-133458
Browse files Browse the repository at this point in the history
Do not try to convert event data to a number
  • Loading branch information
sergeuz authored Jan 21, 2025
2 parents ee1ba49 + b67397f commit 0cc9616
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,11 @@ class ApiClient {
const handlers = this._handlers.get(name);
if (handlers) {
if (data.length) {
let val = data[0];
const intVal = Number.parseInt(val);
if (!Number.isNaN(intVal)) {
val = intVal;
}
const d = data[0];
let received = false;
handlers.forEach(h => {
if (h.resolve) {
h.resolve(val);
h.resolve(d);
h.resolve = null;
h.reject = null;
clearTimeout(h.timer);
Expand Down

0 comments on commit 0cc9616

Please sign in to comment.