Refactor long if block in getItems in listings
[MAILPOET-1537]
This commit is contained in:
@@ -456,9 +456,9 @@ const Listing = React.createClass({
|
||||
this.initWithParams(params);
|
||||
},
|
||||
getItems: function getItems() {
|
||||
if (this.isComponentMounted) {
|
||||
this.setState({ loading: true });
|
||||
if (!this.isComponentMounted) return;
|
||||
|
||||
this.setState({ loading: true });
|
||||
this.clearSelection();
|
||||
|
||||
MailPoet.Ajax.post({
|
||||
@@ -504,7 +504,6 @@ const Listing = React.createClass({
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleRestoreItem: function handleRestoreItem(id) {
|
||||
this.setState({
|
||||
|
Reference in New Issue
Block a user