pl-fe: fix block and report regression

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-12-29 00:55:45 +01:00
parent 1829645ee0
commit 27eab60b19

View File

@ -50,7 +50,7 @@ const BlockMuteModal: React.FC<BlockMuteModalProps & BaseModalProps> = ({ accoun
if (!account) return null;
const handleClick = () => {
const handleClick = (callback?: () => void) => {
setIsSubmitting(true);
const params: MuteAccountParams | BlockAccountParams = { duration: duration || undefined };
if (action === 'MUTE') {
@ -60,6 +60,7 @@ const BlockMuteModal: React.FC<BlockMuteModalProps & BaseModalProps> = ({ accoun
onSuccess: () => {
setIsSubmitting(false);
onClose('BLOCK_MUTE');
if (callback) callback();
},
});
if (notes && note !== undefined && note !== currentNote) {
@ -70,8 +71,7 @@ const BlockMuteModal: React.FC<BlockMuteModalProps & BaseModalProps> = ({ accoun
};
const handleBlockAndReport = () => {
handleClick();
dispatch(initReport(ReportableEntities.STATUS, account, { statusId }));
handleClick(() => dispatch(initReport(ReportableEntities.STATUS, account, { statusId })));
};
const handleCancel = () => {