pl-fe: or actually move the link to a toast

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk 2024-12-05 14:12:25 +01:00
parent 79e4087aca
commit 6d103b8916

View file

@ -300,7 +300,7 @@ const handleComposeSubmit = (dispatch: AppDispatch, getState: () => RootState, c
dispatch(insertIntoTagHistory(composeId, data.tags || [], status));
toast.success(edit ? messages.editSuccess : messages.success, {
actionLabel: messages.view,
actionLink: `/@${data.account.acct}/posts/${data.id}`,
actionLink: data.visibility === 'direct' ? '/conversations' : `/@${data.account.acct}/posts/${data.id}`,
});
} else {
toast.success(messages.scheduledSuccess, {
@ -432,9 +432,6 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
}
return dispatch(createStatus(params, idempotencyKey, statusId)).then((data) => {
if (!statusId && !data.in_reply_to_id && data.scheduled_at === null && data.visibility === 'direct' && history) {
history.push('/conversations');
}
handleComposeSubmit(dispatch, getState, composeId, data, status, !!statusId);
onSuccess?.();
}).catch((error) => {