submitCompose: make it an async function

This commit is contained in:
Alex Gleason 2023-10-13 13:31:39 -05:00
parent 181df09039
commit 8edd1a830d
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 2 additions and 2 deletions

View File

@ -305,7 +305,7 @@ interface SubmitComposeOpts {
}
const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
(dispatch: AppDispatch, getState: () => RootState) => {
async (dispatch: AppDispatch, getState: () => RootState) => {
const { history, force = false } = opts;
if (!isLoggedIn(getState)) return;
@ -367,7 +367,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
params.group_timeline_visible = compose.group_timeline_visible; // Truth Social
}
dispatch(createStatus(params, idempotencyKey, statusId)).then(function(data) {
return dispatch(createStatus(params, idempotencyKey, statusId)).then(function(data) {
if (!statusId && data.visibility === 'direct' && getState().conversations.mounted <= 0 && history) {
history.push('/messages');
}