Do not reload items for empty trash action

This was causing that 2 requests were fired and potentially could create a race condition
[MAILPOET-3044]
This commit is contained in:
Rostislav Wolny
2020-07-07 14:52:12 +02:00
committed by Veljko V
parent 3fbbf3db6d
commit ec57ac32c6

View File

@@ -381,7 +381,10 @@ class Listing extends React.Component {
action: 'bulkAction',
data,
}).done(() => {
this.getItems();
const isEmptyTrashAction = selectedIds === 'all' && params.group === 'trash' && params.action === 'delete';
if (!isEmptyTrashAction) {
this.getItems();
}
}).fail((response) => {
if (response.errors.length > 0) {
this.context.notices.error(