Turn "to" into array before sending

remove-immutable-compose
danidfra 2024-12-28 18:57:26 -03:00
rodzic 4a00c3c772
commit 75bd511308
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -307,7 +307,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
if (mentions) { if (mentions) {
const trimmedMentions = mentions.map(mention => mention.trim().slice(1)); const trimmedMentions = mentions.map(mention => mention.trim().slice(1));
to = [...to, ...trimmedMentions]; to = new Set([...to, ...trimmedMentions]);
} }
dispatch(submitComposeRequest(composeId)); dispatch(submitComposeRequest(composeId));
@ -326,7 +326,7 @@ const submitCompose = (composeId: string, opts: SubmitComposeOpts = {}) =>
content_type: compose.content_type, content_type: compose.content_type,
poll: compose.poll, poll: compose.poll,
scheduled_at: compose.schedule, scheduled_at: compose.schedule,
to, to: [...to],
}; };
if (compose.privacy === 'group') { if (compose.privacy === 'group') {