feat: fix cropping

This commit is contained in:
Nevo David 2024-07-28 10:50:13 +07:00
parent c03b96215f
commit b07f4b7f59
1 changed files with 13 additions and 4 deletions

View File

@ -282,11 +282,14 @@ export const AddEditModal: FC<{
) {
if (
!(await deleteDialog(
`${key?.integration?.name} post is too long, it will be cropped, do you want to continue?`
`${key?.integration?.name} post is too long, it will be cropped, do you want to continue?`, 'Yes, continue'
))
) {
await key.trigger();
moveToIntegration({identifier: key?.integration?.id!, toPreview: true});
moveToIntegration({
identifier: key?.integration?.id!,
toPreview: true,
});
return;
}
}
@ -298,7 +301,7 @@ export const AddEditModal: FC<{
if (!key.valid) {
await key.trigger();
moveToIntegration({identifier: key?.integration?.id!});
moveToIntegration({ identifier: key?.integration?.id! });
return;
}
}
@ -309,7 +312,13 @@ export const AddEditModal: FC<{
...(postFor ? { order: postFor.id } : {}),
type,
date: dateState.utc().format('YYYY-MM-DDTHH:mm:ss'),
posts: allKeys,
posts: allKeys.map((p) => ({
...p,
value: p.value.map((a) => ({
...a,
content: a.content.slice(0, p.maximumCharacters || 1000000),
})),
})),
}),
});