pl-fe: more renyames
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@@ -354,7 +354,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}, preview
|
||||
|
||||
const status = compose.text;
|
||||
const media = compose.mediaAttachments;
|
||||
const statusId = compose.id;
|
||||
const editedId = compose.editedId;
|
||||
let to = compose.to;
|
||||
const { forceImplicitAddressing } = useSettingsStore.getState().settings;
|
||||
const explicitAddressing = state.auth.client.features.createStatusExplicitAddressing && !forceImplicitAddressing;
|
||||
@@ -392,7 +392,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}, preview
|
||||
|
||||
useModalsStore.getState().actions.closeModal('COMPOSE');
|
||||
|
||||
if (compose.language && !statusId && !preview) {
|
||||
if (compose.language && !editedId && !preview) {
|
||||
useSettingsStore.getState().actions.rememberLanguageUse(compose.language);
|
||||
dispatch(saveSettings());
|
||||
}
|
||||
@@ -404,7 +404,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}, preview
|
||||
const params: CreateStatusParams = {
|
||||
status,
|
||||
in_reply_to_id: compose.inReplyToId || undefined,
|
||||
quote_id: compose.quote || undefined,
|
||||
quote_id: compose.quoteId || undefined,
|
||||
media_ids: media.map(item => item.id),
|
||||
sensitive: compose.sensitive,
|
||||
spoiler_text: compose.spoilerText,
|
||||
@@ -413,7 +413,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}, preview
|
||||
scheduled_at: preview ? undefined : compose.scheduledAt?.toISOString(),
|
||||
language: compose.language || compose.suggestedLanguage || undefined,
|
||||
to: explicitAddressing && to.length ? to : undefined,
|
||||
local_only: compose.local_only,
|
||||
local_only: compose.localOnly,
|
||||
interaction_policy: ['public', 'unlisted', 'private'].includes(compose.visibility) && compose.interactionPolicy || undefined,
|
||||
preview,
|
||||
};
|
||||
@@ -458,8 +458,8 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}, preview
|
||||
params.overwrite = compose.redactingOverwrite;
|
||||
}
|
||||
|
||||
return dispatch(createStatus(params, idempotencyKey, statusId, compose.redacting)).then((data) => {
|
||||
handleComposeSubmit(dispatch, getState, composeId, data, status, !!statusId, compose.redacting);
|
||||
return dispatch(createStatus(params, idempotencyKey, editedId, compose.redacting)).then((data) => {
|
||||
handleComposeSubmit(dispatch, getState, composeId, data, status, !!editedId, compose.redacting);
|
||||
onSuccess?.();
|
||||
}).catch((error) => {
|
||||
dispatch(submitComposeFail(composeId, error));
|
||||
|
||||
@@ -36,18 +36,18 @@ const STATUS_UNMUTE_SUCCESS = 'STATUS_UNMUTE_SUCCESS' as const;
|
||||
|
||||
const STATUS_UNFILTER = 'STATUS_UNFILTER' as const;
|
||||
|
||||
const createStatus = (params: CreateStatusParams, idempotencyKey: string, statusId: string | null, redacting = false) =>
|
||||
const createStatus = (params: CreateStatusParams, idempotencyKey: string, editedId: string | null, redacting = false) =>
|
||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||
if (!params.preview) dispatch<StatusesAction>({ type: STATUS_CREATE_REQUEST, params, idempotencyKey, editing: !!statusId, redacting });
|
||||
if (!params.preview) dispatch<StatusesAction>({ type: STATUS_CREATE_REQUEST, params, idempotencyKey, editing: !!editedId, redacting });
|
||||
|
||||
const client = getClient(getState());
|
||||
|
||||
return (
|
||||
statusId === null
|
||||
editedId === null
|
||||
? client.statuses.createStatus(params)
|
||||
: redacting
|
||||
? client.admin.statuses.redactStatus(statusId, params)
|
||||
: client.statuses.editStatus(statusId, params)
|
||||
? client.admin.statuses.redactStatus(editedId, params)
|
||||
: client.statuses.editStatus(editedId, params)
|
||||
)
|
||||
.then((status) => {
|
||||
if (params.preview) return status;
|
||||
@@ -61,7 +61,7 @@ const createStatus = (params: CreateStatusParams, idempotencyKey: string, status
|
||||
queryClient.invalidateQueries(scheduledStatusesQueryOptions);
|
||||
}
|
||||
|
||||
dispatch<StatusesAction>({ type: STATUS_CREATE_SUCCESS, status, params, idempotencyKey, editing: !!statusId });
|
||||
dispatch<StatusesAction>({ type: STATUS_CREATE_SUCCESS, status, params, idempotencyKey, editing: !!editedId });
|
||||
|
||||
// Poll the backend for the updated card
|
||||
if (expectsCard) {
|
||||
@@ -82,7 +82,7 @@ const createStatus = (params: CreateStatusParams, idempotencyKey: string, status
|
||||
|
||||
return status;
|
||||
}).catch(error => {
|
||||
dispatch<StatusesAction>({ type: STATUS_CREATE_FAIL, error, params, idempotencyKey, editing: !!statusId });
|
||||
dispatch<StatusesAction>({ type: STATUS_CREATE_FAIL, error, params, idempotencyKey, editing: !!editedId });
|
||||
throw error;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user