pl-fe: cleanup
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
parent
615f2cb0cc
commit
7a85ef413b
2 changed files with 19 additions and 24 deletions
|
@ -29,20 +29,17 @@ const ScheduledStatusActionBar: React.FC<IScheduledStatusActionBar> = ({ status
|
|||
const { settings } = useSettingsStore();
|
||||
|
||||
const handleCancelClick = () => {
|
||||
dispatch((_, getState) => {
|
||||
|
||||
const deleteModal = settings.deleteModal;
|
||||
if (!deleteModal) {
|
||||
dispatch(cancelScheduledStatus(status.id));
|
||||
} else {
|
||||
openModal('CONFIRM', {
|
||||
heading: intl.formatMessage(messages.deleteHeading),
|
||||
message: intl.formatMessage(messages.deleteMessage),
|
||||
confirm: intl.formatMessage(messages.deleteConfirm),
|
||||
onConfirm: () => dispatch(cancelScheduledStatus(status.id)),
|
||||
});
|
||||
}
|
||||
});
|
||||
const deleteModal = settings.deleteModal;
|
||||
if (!deleteModal) {
|
||||
dispatch(cancelScheduledStatus(status.id));
|
||||
} else {
|
||||
openModal('CONFIRM', {
|
||||
heading: intl.formatMessage(messages.deleteHeading),
|
||||
message: intl.formatMessage(messages.deleteMessage),
|
||||
confirm: intl.formatMessage(messages.deleteConfirm),
|
||||
onConfirm: () => dispatch(cancelScheduledStatus(status.id)),
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -143,18 +143,16 @@ const Thread: React.FC<IThread> = ({
|
|||
const handleModalReblog = (status: Pick<SelectedStatus, 'id'>) => dispatch(reblog(status));
|
||||
|
||||
const handleReblogClick = (status: SelectedStatus, e?: React.MouseEvent) => {
|
||||
dispatch((_, getState) => {
|
||||
const boostModal = settings.boostModal;
|
||||
if (status.reblogged) {
|
||||
dispatch(unreblog(status));
|
||||
const boostModal = settings.boostModal;
|
||||
if (status.reblogged) {
|
||||
dispatch(unreblog(status));
|
||||
} else {
|
||||
if ((e && e.shiftKey) || !boostModal) {
|
||||
handleModalReblog(status);
|
||||
} else {
|
||||
if ((e && e.shiftKey) || !boostModal) {
|
||||
handleModalReblog(status);
|
||||
} else {
|
||||
openModal('BOOST', { statusId: status.id, onReblog: handleModalReblog });
|
||||
}
|
||||
openModal('BOOST', { statusId: status.id, onReblog: handleModalReblog });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const handleMentionClick = (account: Pick<Account, 'acct'>) => dispatch(mentionCompose(account));
|
||||
|
|
Loading…
Reference in a new issue