diff --git a/pkg/npm/http-api/package.json b/pkg/npm/http-api/package.json index 8b5f49767..75bba5e5c 100644 --- a/pkg/npm/http-api/package.json +++ b/pkg/npm/http-api/package.json @@ -1,6 +1,6 @@ { "name": "@urbit/http-api", - "version": "2.1.0", + "version": "2.1.1", "license": "MIT", "description": "Library to interact with an Urbit ship over HTTP", "repository": { diff --git a/pkg/npm/http-api/src/Urbit.ts b/pkg/npm/http-api/src/Urbit.ts index ab473e6d3..aa59149d1 100644 --- a/pkg/npm/http-api/src/Urbit.ts +++ b/pkg/npm/http-api/src/Urbit.ts @@ -235,9 +235,9 @@ export class Urbit { console.log('Received SSE: ', event); } if (!event.id) return; - this.lastEventId = parseInt(event.id, 10); - if (this.lastEventId - this.lastAcknowledgedEventId > 20) { - this.ack(this.lastEventId); + const eventId = parseInt(event.id, 10); + if (eventId - this.lastAcknowledgedEventId > 20) { + this.ack(eventId); } if (event.data && JSON.parse(event.data)) { @@ -312,7 +312,7 @@ export class Urbit { * */ reset() { - if(this.verbose) { + if (this.verbose) { console.log('resetting'); } this.delete();