diff --git a/opentech/static_src/src/app/src/components/Listing/index.js b/opentech/static_src/src/app/src/components/Listing/index.js index 76a7ce1035074474944bd8bda5044696a78bda45..5e247b5b99a0fd049fe1d84ddbd4e6f42e7bb56c 100644 --- a/opentech/static_src/src/app/src/components/Listing/index.js +++ b/opentech/static_src/src/app/src/components/Listing/index.js @@ -62,7 +62,8 @@ export default class Listing extends React.Component { ); } - retryButton = (handleRetry) => { + renderRetryButton = () => { + const { handleRetry } = this.props; return <a className="listing__help-link" onClick={handleRetry}>Refresh</a>; } @@ -73,7 +74,7 @@ export default class Listing extends React.Component { <h5>Something went wrong!</h5> <p>{ error }</p> { !navigator.onLine && <p>You appear to be offline.</p>} - { handleRetry && this.retryButton(handleRetry) } + { handleRetry && this.renderRetryButton() } </li> ) } @@ -96,7 +97,7 @@ export default class Listing extends React.Component { </div> <p className="listing__help-text listing__help-text--standout">Something went wrong!</p> <p className="listing__help-text">Sorry we couldn't load the notes</p> - { this.handleRetry(handleRetry) } + { this.renderRetryButton() } </> } </div> diff --git a/opentech/static_src/src/app/src/containers/NoteListing.js b/opentech/static_src/src/app/src/containers/NoteListing.js index 587bc3d0e9ba558cdb46c9cb962a96bf3fe52805..0e4e12801a3d4a1a225306e9a6628fed0045f98a 100644 --- a/opentech/static_src/src/app/src/containers/NoteListing.js +++ b/opentech/static_src/src/app/src/containers/NoteListing.js @@ -46,7 +46,7 @@ class NoteListing extends React.Component { } componentWillUnmount() { - this.pollNotes = null; + clearInterval(this.pollNotes) } handleRetry = () => { diff --git a/opentech/static_src/src/app/src/redux/reducers/submissions.js b/opentech/static_src/src/app/src/redux/reducers/submissions.js index d8772288fc06075451bf7b8fcfb96dfeb2447357..df94c9584c3fbe29e9fd0cc250a9be4c50c6b3b8 100644 --- a/opentech/static_src/src/app/src/redux/reducers/submissions.js +++ b/opentech/static_src/src/app/src/redux/reducers/submissions.js @@ -15,7 +15,7 @@ import { import { UPDATE_NOTES, UPDATE_NOTE } from '@actions/notes' -function submission(state={id: null, comments: []}, action) { +function submission(state={comments: []}, action) { switch(action.type) { case START_LOADING_SUBMISSION: return {