Skip to content

Commit

Permalink
Fixed Contract filter never unsubscribing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Apr 15, 2020
1 parent 284771e commit 39c78f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/contracts/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,13 @@ export class Contract {
_checkRunningEvents(runningEvent: RunningEvent): void {
if (runningEvent.listenerCount() === 0) {
delete this._runningEvents[runningEvent.tag];
}

// If we have a poller for this, remove it
const emit = this._wrappedEmits[runningEvent.tag];
if (!emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
// If we have a poller for this, remove it
const emit = this._wrappedEmits[runningEvent.tag];
if (emit) {
this.provider.off(runningEvent.filter, emit);
delete this._wrappedEmits[runningEvent.tag];
}
}
}

Expand Down

0 comments on commit 39c78f3

Please sign in to comment.