mirror of
https://github.com/ascribe/onion.git
synced 2024-12-31 09:07:48 +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 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({
|
||||
urlMap: ApiUrls,
|
||||
http: {
|
||||
|
@ -35,6 +35,7 @@ let PieceListBulkModal = React.createClass({
|
||||
|
||||
componentWillUnmount() {
|
||||
EditionListStore.unlisten(this.onChange);
|
||||
UserStore.unlisten(this.onChange);
|
||||
},
|
||||
|
||||
fetchSelectedPieceEditionList() {
|
||||
|
@ -19,7 +19,7 @@ export const FormMixin = {
|
||||
this.clearErrors();
|
||||
fetch
|
||||
.post(this.url(), { body: this.getFormData() })
|
||||
.then(response => this.props.handleSuccess())
|
||||
.then(() => this.props.handleSuccess())
|
||||
.catch(this.handleError);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user