nicolium: multilanguage posting improvements

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-28 14:47:20 +01:00
parent d91c3fbadc
commit f72568c893
3 changed files with 18 additions and 2 deletions

View File

@@ -59,7 +59,14 @@ const DraftStatusActionBar: React.FC<IDraftStatusActionBar> = ({ source, status
const poll = status.poll_id
? queryClient.getQueryData(queryKeys.statuses.polls.show(status.poll_id))
: undefined;
setComposeToStatus(status, poll, source, false, source.draft_id, source.editorState);
setComposeToStatus(
status,
poll,
{ ...source, location: null },
false,
source.draft_id,
source.editorState,
);
openModal('COMPOSE');
};

View File

@@ -24,6 +24,10 @@ const draftStatusSchema = v.pipe(
in_reply_to: draft.inReplyTo,
media_attachments: draft.mediaAttachments,
spoiler_text: draft.spoilerText,
spoiler_text_map: draft.spoilerTextMap,
text: draft.text,
text_map: draft.textMap,
language: draft.language,
...draft,
})),
v.object({
@@ -39,7 +43,10 @@ const draftStatusSchema = v.pipe(
schedule: v.fallback(v.nullable(v.string()), null),
sensitive: v.fallback(v.boolean(), false),
spoiler_text: v.fallback(v.string(), ''),
spoiler_text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
text: v.fallback(v.string(), ''),
text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
language: v.fallback(v.string(), ''),
}),
);

View File

@@ -325,7 +325,7 @@ interface ComposeActions {
| 'visibility'
>,
poll: Poll | null | undefined,
source: Pick<StatusSource, 'content_type' | 'text' | 'spoiler_text'>,
source: Omit<StatusSource, 'id'>,
withRedraft?: boolean,
draftId?: string | null,
editorState?: string | null,
@@ -431,6 +431,7 @@ const useComposeStore = create<ComposeStore>()(
compose.editedId = status.id;
}
compose.text = source.text;
compose.textMap = source.text_map ?? {};
compose.to = mentions;
compose.parentRebloggedById = null;
compose.inReplyToId = status.in_reply_to_id;
@@ -451,6 +452,7 @@ const useComposeStore = create<ComposeStore>()(
compose.redacting = redacting ?? false;
compose.spoilerText = source.spoiler_text;
compose.spoilerTextMap = source.spoiler_text_map ?? {};
if (poll) {
compose.poll = newPoll({