feat: x can have maximum 4 pictures

This commit is contained in:
Nevo David 2024-10-04 17:05:40 +07:00
parent 237bfcbfec
commit 7fdad8d0b4
1 changed files with 7 additions and 1 deletions

View File

@ -102,4 +102,10 @@ const XPreview: FC = (props) => {
);
};
export default withProvider(null, XPreview, undefined, undefined, 280);
export default withProvider(null, XPreview, undefined, async (posts) => {
if (posts.some(p => p.length > 4)) {
return 'There can be maximum 4 pictures in a post.';
}
return true;
}, 280);