Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Change newsletter response
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarbet committed Jan 5, 2018
1 parent 0d61ccd commit de75f8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/popup/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class Popup extends Component {
const { onClose, reset } = this.props;
const res = nextProps.response;

if (res && res.status === 'subscribed') {
if (res && res.ok) {
this.hidePopup = setTimeout(() => {
reset();
onClose();
Expand Down Expand Up @@ -176,7 +176,7 @@ export default class Popup extends Component {
...props
} = this.props;

const hasResponse = response && response.status === 'subscribed';
const hasResponse = response && response.ok;
const isSuccess = hasResponse && 'Subscribed!';

return (
Expand All @@ -202,7 +202,6 @@ export default class Popup extends Component {
<form
method="POST"
onSubmit={this.onSubmit}
action="/api/mailchimp/subscribe"
>
<Field
label={placeholder}
Expand Down

0 comments on commit de75f8d

Please sign in to comment.