From 615f2cb0cccd920cbc59c8c146d831e23ca60890 Mon Sep 17 00:00:00 2001 From: mkljczk Date: Wed, 4 Dec 2024 17:07:05 +0100 Subject: [PATCH] pl-fe: cleanup Signed-off-by: mkljczk --- .../components/draft-status-action-bar.tsx | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx b/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx index 0f25abb70..20a4f7be7 100644 --- a/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx +++ b/packages/pl-fe/src/features/draft-statuses/components/draft-status-action-bar.tsx @@ -31,20 +31,17 @@ const DraftStatusActionBar: React.FC = ({ source, status const dispatch = useAppDispatch(); const handleCancelClick = () => { - dispatch((_, getState) => { - - const deleteModal = settings.deleteModal; - if (!deleteModal) { - dispatch(cancelDraftStatus(source.draft_id)); - } else { - openModal('CONFIRM', { - heading: intl.formatMessage(messages.deleteHeading), - message: intl.formatMessage(messages.deleteMessage), - confirm: intl.formatMessage(messages.deleteConfirm), - onConfirm: () => dispatch(cancelDraftStatus(source.draft_id)), - }); - } - }); + const deleteModal = settings.deleteModal; + if (!deleteModal) { + dispatch(cancelDraftStatus(source.draft_id)); + } else { + openModal('CONFIRM', { + heading: intl.formatMessage(messages.deleteHeading), + message: intl.formatMessage(messages.deleteMessage), + confirm: intl.formatMessage(messages.deleteConfirm), + onConfirm: () => dispatch(cancelDraftStatus(source.draft_id)), + }); + } }; const handleEditClick = () => {