mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
set state bug fix
This commit is contained in:
parent
8a17208643
commit
b49f3fe9f2
21
js/app.js
21
js/app.js
@ -11,27 +11,6 @@ import ApiUrls from './constants/api_urls';
|
|||||||
import routes from './routes';
|
import routes from './routes';
|
||||||
import fetch from './utils/fetch';
|
import fetch from './utils/fetch';
|
||||||
|
|
||||||
/*
|
|
||||||
Taken from
|
|
||||||
http://stackoverflow.com/questions/30613447/how-to-debug-reactjss-setstate?noredirect=1#comment49301874_30613447
|
|
||||||
|
|
||||||
<remove this in production>
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
var warn = console.warn;
|
|
||||||
console.warn = function(warning) {
|
|
||||||
if (/(setState)/.test(warning)) {
|
|
||||||
throw new Error(warning);
|
|
||||||
}
|
|
||||||
warn.apply(console, arguments);
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
</remove this in production>
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
fetch.defaults({
|
fetch.defaults({
|
||||||
urlMap: ApiUrls,
|
urlMap: ApiUrls,
|
||||||
http: {
|
http: {
|
||||||
|
@ -35,6 +35,7 @@ let PieceListBulkModal = React.createClass({
|
|||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
EditionListStore.unlisten(this.onChange);
|
EditionListStore.unlisten(this.onChange);
|
||||||
|
UserStore.unlisten(this.onChange);
|
||||||
},
|
},
|
||||||
|
|
||||||
fetchSelectedPieceEditionList() {
|
fetchSelectedPieceEditionList() {
|
||||||
|
@ -19,7 +19,7 @@ export const FormMixin = {
|
|||||||
this.clearErrors();
|
this.clearErrors();
|
||||||
fetch
|
fetch
|
||||||
.post(this.url(), { body: this.getFormData() })
|
.post(this.url(), { body: this.getFormData() })
|
||||||
.then(response => this.props.handleSuccess())
|
.then(() => this.props.handleSuccess())
|
||||||
.catch(this.handleError);
|
.catch(this.handleError);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user