mirror of https://github.com/status-im/op-geth.git
jsre: timer bugfix when clearInterval was called from within the callback
This commit is contained in:
parent
e9a80518c7
commit
2f65ddc501
|
@ -154,7 +154,9 @@ loop:
|
|||
if err != nil {
|
||||
fmt.Println("js error:", err, arguments)
|
||||
}
|
||||
if timer.interval {
|
||||
|
||||
_, inreg := registry[timer] // when clearInterval is called from within the callback don't reset it
|
||||
if timer.interval && inreg {
|
||||
timer.timer.Reset(timer.duration)
|
||||
} else {
|
||||
delete(registry, timer)
|
||||
|
|
Loading…
Reference in New Issue