call destroyAsync on unmount
This commit is contained in:
parent
cbb23a42e2
commit
f56839ec6b
@ -466,7 +466,8 @@ export class SwapQuoter {
|
||||
* Destroys any subscriptions or connections.
|
||||
*/
|
||||
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) {
|
||||
this._swapQuoteHeartbeat.stop();
|
||||
}
|
||||
const state = this._store.getState();
|
||||
// tslint:disable-next-line: no-floating-promises
|
||||
state.providerState.swapQuoter.destroyAsync();
|
||||
}
|
||||
public render(): React.ReactNode {
|
||||
return (
|
||||
|
Loading…
x
Reference in New Issue
Block a user