From ec4fdba04eec0d892936f77e59dba777fa039858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Fri, 22 Dec 2023 10:34:32 +0100 Subject: [PATCH] Fix auto delete post when dismissed by a plugin (#25791) --- .../src/packages/mattermost-redux/src/actions/posts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/channels/src/packages/mattermost-redux/src/actions/posts.ts b/webapp/channels/src/packages/mattermost-redux/src/actions/posts.ts index f7006d4277..6dd089f1d1 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/actions/posts.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/actions/posts.ts @@ -276,7 +276,8 @@ export function createPost(post: Post, files: any[] = []) { error.server_error_id === 'api.post.create_post.town_square_read_only' || error.server_error_id === 'plugin.message_will_be_posted.dismiss_post' ) { - actions.push(removePost(data) as any); + // RemovePost is a Thunk, and not handled by batchActions + dispatch(removePost(data)); } else { actions.push(receivedPost(data, crtEnabled)); }