mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix unbound function in swaps controller (#9496)
The `_fetchAndSetSwapsLiveness` was accidentally passed to `setInterval` without being bound first, so the `this` reference was not defined when it was called. It is now bound before being passed to `setInterval`.
This commit is contained in:
parent
1ba4061f46
commit
e8774f615d
@ -515,7 +515,7 @@ export default class SwapsController {
|
||||
if (window.navigator.onLine && intervalId === null) {
|
||||
// Set the interval first to prevent race condition between listener and
|
||||
// initial call to this function.
|
||||
intervalId = setInterval(this._fetchAndSetSwapsLiveness, TEN_MINUTES_MS)
|
||||
intervalId = setInterval(this._fetchAndSetSwapsLiveness.bind(this), TEN_MINUTES_MS)
|
||||
this._fetchAndSetSwapsLiveness()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user