Merge pull request #1516 from mailpoet/listings-warning
Emails listing JS warning fix [MAILPOET-1537]
This commit is contained in:
@@ -456,9 +456,9 @@ const Listing = React.createClass({
|
|||||||
this.initWithParams(params);
|
this.initWithParams(params);
|
||||||
},
|
},
|
||||||
getItems: function getItems() {
|
getItems: function getItems() {
|
||||||
if (this.isComponentMounted) {
|
if (!this.isComponentMounted) return;
|
||||||
this.setState({ loading: true });
|
|
||||||
|
|
||||||
|
this.setState({ loading: true });
|
||||||
this.clearSelection();
|
this.clearSelection();
|
||||||
|
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
@@ -476,8 +476,10 @@ const Listing = React.createClass({
|
|||||||
sort_order: this.state.sort_order,
|
sort_order: this.state.sort_order,
|
||||||
},
|
},
|
||||||
}).always(() => {
|
}).always(() => {
|
||||||
|
if (!this.isComponentMounted) return;
|
||||||
this.setState({ loading: false });
|
this.setState({ loading: false });
|
||||||
}).done((response) => {
|
}).done((response) => {
|
||||||
|
if (!this.isComponentMounted) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
items: response.data || [],
|
items: response.data || [],
|
||||||
filters: response.meta.filters || {},
|
filters: response.meta.filters || {},
|
||||||
@@ -504,7 +506,6 @@ const Listing = React.createClass({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
handleRestoreItem: function handleRestoreItem(id) {
|
handleRestoreItem: function handleRestoreItem(id) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
Reference in New Issue
Block a user