submitCompose: make it an async function
This commit is contained in:
parent
181df09039
commit
8edd1a830d
|
@ -305,7 +305,7 @@ interface SubmitComposeOpts {
|
||||||
}
|
}
|
||||||
|
|
||||||
const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
|
const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
async (dispatch: AppDispatch, getState: () => RootState) => {
|
||||||
const { history, force = false } = opts;
|
const { history, force = false } = opts;
|
||||||
|
|
||||||
if (!isLoggedIn(getState)) return;
|
if (!isLoggedIn(getState)) return;
|
||||||
|
@ -367,7 +367,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
|
||||||
params.group_timeline_visible = compose.group_timeline_visible; // Truth Social
|
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) {
|
if (!statusId && data.visibility === 'direct' && getState().conversations.mounted <= 0 && history) {
|
||||||
history.push('/messages');
|
history.push('/messages');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue