From 2aabe29289aad644c6cf13af538753c1c5b98769 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Mon, 10 Apr 2017 13:07:33 -0700 Subject: [PATCH] Stop send interval on request change (#136) --- app/ui/components/request-pane.js | 3 ++- app/ui/components/request-url-bar.js | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/ui/components/request-pane.js b/app/ui/components/request-pane.js index 684f89b3a..ff2f3dcc9 100644 --- a/app/ui/components/request-pane.js +++ b/app/ui/components/request-pane.js @@ -198,7 +198,7 @@ class RequestPane extends PureComponent {
diff --git a/app/ui/components/request-url-bar.js b/app/ui/components/request-url-bar.js index f2b3c2147..41a4d1986 100644 --- a/app/ui/components/request-url-bar.js +++ b/app/ui/components/request-url-bar.js @@ -180,6 +180,11 @@ class RequestUrlBar extends PureComponent { } } + _handleResetTimeouts () { + this._handleStopTimeout(); + this._handleStopInterval(); + } + _handleClickSend (e) { const metaPressed = isMac() ? e.metaKey : e.ctrlKey; @@ -202,6 +207,12 @@ class RequestUrlBar extends PureComponent { document.body.removeEventListener('keydown', this._handleKeyDown); } + componentWillReceiveProps (nextProps) { + if (nextProps.requestId !== this.props.requestId) { + this._handleResetTimeouts(); + } + } + renderSendButton () { const {currentInterval, currentTimeout, downloadPath} = this.state; @@ -278,7 +289,8 @@ class RequestUrlBar extends PureComponent { method, handleRender, handleGetRenderContext, - handleAutocompleteUrls + handleAutocompleteUrls, + uniquenessKey } = this.props; return ( @@ -288,6 +300,7 @@ class RequestUrlBar extends PureComponent {