call destroyAsync on unmount

This commit is contained in:
David Sun 2020-02-24 12:24:07 -05:00
parent cbb23a42e2
commit f56839ec6b
2 changed files with 5 additions and 1 deletions

View File

@ -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();
}
/**

View File

@ -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 (