Refactor long if block in getItems in listings

[MAILPOET-1537]
This commit is contained in:
Rostislav Wolny
2018-09-20 10:14:12 +02:00
parent 5b7a5bbf0f
commit f5db5c3881

View File

@@ -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({
@@ -504,7 +504,6 @@ const Listing = React.createClass({
); );
} }
}); });
}
}, },
handleRestoreItem: function handleRestoreItem(id) { handleRestoreItem: function handleRestoreItem(id) {
this.setState({ this.setState({