diff --git a/ghost/admin/app/components/posts-list/context-menu.js b/ghost/admin/app/components/posts-list/context-menu.js index e388a2a355..02b89371fa 100644 --- a/ghost/admin/app/components/posts-list/context-menu.js +++ b/ghost/admin/app/components/posts-list/context-menu.js @@ -288,32 +288,26 @@ export default class PostsContextMenu extends Component { @task *unschedulePostsTask() { const updatedModels = this.selectionList.availableModels; - try { - // Perform the bulk edit action to unschedule the posts - yield this.performBulkEdit('unschedule'); - this.notifications.showNotification(this.#getToastMessage('unscheduled'), {type: 'success'}); + yield this.performBulkEdit('unschedule'); + this.notifications.showNotification(this.#getToastMessage('unscheduled'), {type: 'success'}); - // Update the models on the client side - for (const post of updatedModels) { - if (post.status === 'scheduled') { - // We need to do it this way to prevent marking the model as dirty - this.store.push({ - data: { - id: post.id, - type: this.type, - attributes: { - status: 'draft' - } + // Update the models on the client side + for (const post of updatedModels) { + if (post.status === 'scheduled') { + // We need to do it this way to prevent marking the model as dirty + this.store.push({ + data: { + id: post.id, + type: this.type, + attributes: { + status: 'draft' } - }); - } + } + }); } - - // Remove posts that no longer match the filter - this.updateFilteredPosts(); - } catch (error) { - this.notifications.showAPIError(error, {key: `${this.type}.unschedule.failed`}); } + + this.updateFilteredPosts(); return true; }