Merge pull request #2492 from 0xProject/fix/instant/constant-polling
[Fix] Instant call destroyAsync on unmount
This commit is contained in:
commit
880b9413f6
@ -466,7 +466,8 @@ export class SwapQuoter {
|
|||||||
* Destroys any subscriptions or connections.
|
* Destroys any subscriptions or connections.
|
||||||
*/
|
*/
|
||||||
public async destroyAsync(): Promise<void> {
|
public async destroyAsync(): Promise<void> {
|
||||||
return this.orderbook.destroyAsync();
|
await this._protocolFeeUtils.destroyAsync();
|
||||||
|
await this.orderbook.destroyAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -153,6 +153,9 @@ export class ZeroExInstantProvider extends React.PureComponent<ZeroExInstantProv
|
|||||||
if (this._swapQuoteHeartbeat) {
|
if (this._swapQuoteHeartbeat) {
|
||||||
this._swapQuoteHeartbeat.stop();
|
this._swapQuoteHeartbeat.stop();
|
||||||
}
|
}
|
||||||
|
const state = this._store.getState();
|
||||||
|
// tslint:disable-next-line: no-floating-promises
|
||||||
|
state.providerState.swapQuoter.destroyAsync();
|
||||||
}
|
}
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user