Reverted bulk trash logic

This commit is contained in:
del 2021-05-21 01:18:46 +08:00
parent d74d37ce67
commit 67e7521044
1 changed files with 14 additions and 12 deletions

View File

@ -19,7 +19,11 @@ async function trashExistingPosts() {
// If this selector doesn't exist there are no posts for us to delete.
const bulkSelector = await page.$( '#bulk-action-selector-top' );
if ( bulkSelector ) {
if ( ! bulkSelector ) {
await merchant.logout();
return;
}
// Select all posts.
await page.waitForSelector( '#cb-select-all-1' );
await page.click( '#cb-select-all-1' );
@ -30,8 +34,6 @@ async function trashExistingPosts() {
await page.waitForXPath(
'//*[contains(@class, "updated notice")]/p[contains(text(), "moved to the Trash.")]'
);
}
await merchant.logout();
}