Merge pull request #2492 from 0xProject/fix/instant/constant-polling

[Fix] Instant call destroyAsync on unmount
This commit is contained in:
David Sun 2020-02-26 19:36:48 -05:00 committed by GitHub
commit 880b9413f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 (