Fix job submit infinite loop/promo ajax bugs

This commit is contained in:
Berkeley Martinez
2016-01-19 13:36:41 -08:00
parent c3869ab717
commit c752b918ac
4 changed files with 6 additions and 10 deletions

View File

@ -55,6 +55,11 @@ export default contain(
jobActions: PropTypes.object jobActions: PropTypes.object
}, },
componentDidMount() {
const { jobActions } = this.props;
jobActions.clearPromo();
},
goToJobBoard() { goToJobBoard() {
const { appActions } = this.props; const { appActions } = this.props;
appActions.goTo('/jobs'); appActions.goTo('/jobs');

View File

@ -1,5 +1,4 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
import { Lifecycle } from 'react-router';
import { Button, Row, Col } from 'react-bootstrap'; import { Button, Row, Col } from 'react-bootstrap';
import { contain } from 'thundercats-react'; import { contain } from 'thundercats-react';
@ -26,8 +25,6 @@ export default contain(
jobActions: PropTypes.object jobActions: PropTypes.object
}, },
mixins: [Lifecycle],
componentDidMount() { componentDidMount() {
const { appActions, job } = this.props; const { appActions, job } = this.props;
// redirect user in client // redirect user in client
@ -36,11 +33,6 @@ export default contain(
} }
}, },
routerWillLeave() {
const { jobActions } = this.props;
jobActions.clearPromo();
},
render() { render() {
const { appActions, job, jobActions } = this.props; const { appActions, job, jobActions } = this.props;

View File

@ -138,7 +138,6 @@ export default Actions({
body.type = type; body.type = type;
} }
return this.postJSON$('/api/promos/getButton', body) return this.postJSON$('/api/promos/getButton', body)
.pluck('response')
.map(({ promo }) => { .map(({ promo }) => {
if (!promo || !promo.buttonId) { if (!promo || !promo.buttonId) {
return noOper; return noOper;

View File

@ -90,7 +90,7 @@
"loopback": "^2.22.0", "loopback": "^2.22.0",
"loopback-boot": "^2.13.0", "loopback-boot": "^2.13.0",
"loopback-component-passport": "^1.6.0", "loopback-component-passport": "^1.6.0",
"loopback-connector-mongodb": "1.13.3", "loopback-connector-mongodb": "1.13.0",
"merge-stream": "^1.0.0", "merge-stream": "^1.0.0",
"method-override": "^2.3.0", "method-override": "^2.3.0",
"moment": "^2.10.2", "moment": "^2.10.2",