1
0
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:
Tim Daubenschütz 2015-06-08 14:51:13 +02:00
parent 8a17208643
commit b49f3fe9f2
3 changed files with 2 additions and 22 deletions

View File

@ -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: {

View File

@ -35,6 +35,7 @@ let PieceListBulkModal = React.createClass({
componentWillUnmount() {
EditionListStore.unlisten(this.onChange);
UserStore.unlisten(this.onChange);
},
fetchSelectedPieceEditionList() {

View File

@ -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);
},