Skip to content

Conversation

@Enchu
Copy link
Contributor

@Enchu Enchu commented Nov 23, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Nov 23, 2025

Name Status Preview
xi.web ✔️Success✔️ Visit Preview

return 'Файл слишком большой';
}

return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это наверное вообще не нужно, если не выполнится ни одно условие то итак будет undefined

});
}

return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

эта функция по идее void по этому тут не нужен return в конце

/>
<FileUploader
onChange={handleInput}
// @ts-expect-error - onError пересекается с пропсом DefaultInputPropsT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это нужно поправить на уровне компонента, иначе он сломан останется. Нужен PR в xi.kit


const validateBeforeUpload = (files: File[]): string | undefined => {
const file = files[0];
const allowedTypes = ['image/png', 'image/jpeg', 'image/jpg'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Как будто нам нужно расширить поддерживаемые типы. Как минимум, я знаю, что есть ещё webp, который будет работать. Я бы здесь поисследовал и потестировал данное поведение

const file = files[0];
const allowedTypes = ['image/png', 'image/jpeg', 'image/jpg'];
if (!allowedTypes.includes(file.type)) {
return 'Поддерживаются только файлы PNG и JPEG';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Подсказка должна совпадать с allowedTypes

return;
}

if (file.size > 5 * 1024 * 1024) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Думаю, что это 5 Мб

@unknownproperty unknownproperty merged commit 98b4942 into main Dec 29, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants