Skip to content
Permalink
Browse files

fix(EventListener): only stop watching if listener exists

  • Loading branch information...
satello committed Jun 11, 2018
1 parent bad306b commit c28f20c2f9e5ec4684db898a37da640a7a56712c
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/utils/EventListener.js
@@ -180,11 +180,13 @@ class EventListener {
* @param {string} contractImplementationInstance - Address of the contract to stop watching
*/
stopWatchingForEvents = contractImplementationInstance => {
if (contractImplementationInstance)
this.watcherInstances[
if (contractImplementationInstance) {
const watcherInstance = this.watcherInstances[
contractImplementationInstance.getContractAddress()
].stopWatching()
else
]

if (watcherInstance) watcherInstance.stopWatching()
} else
this.contractInstances.forEach(instance => {
this.watcherInstances[instance.getContractAddress()].stopWatching()
})

0 comments on commit c28f20c

Please sign in to comment.
You can’t perform that action at this time.