1
0
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:
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 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: {

View File

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

View File

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