Skip to content

Conversation

@Enchu
Copy link
Contributor

@Enchu Enchu commented Dec 4, 2025

No description provided.

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
xi-storybook Ready Ready Preview Comment Dec 11, 2025 3:34pm

Comment on lines 145 to 151
if (validationError) {
onError(validationError);
if(typeof validationError === 'string'){
onFileError(validationError);
}else{
onFileError(validationError.titleError, validationError.subtitleError);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Что-то случилось с форматированием

const validationError = validateBeforeUpload(fileList);
if (validationError) {
onError(validationError);
if(typeof validationError === 'string'){
Copy link
Contributor

Choose a reason for hiding this comment

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

Странно делать проверку, что valisationError строка, если ты в типизации указал, что точно нет

descriptionText?: string;
onChange: (files: File[]) => void;
validateBeforeUpload?: (files: File[]) => string | undefined;
validateBeforeUpload?: (files: File[]) => ValidationError | 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 в коде ни для типов, ни для данных. Если мы хотим показать, что чего-то нет, то это null


const handleError = (fileList: File[]): boolean => {
if (!enableErrorHandling || !onError) {
if (!enableErrorHandling || !onFileError) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Как будто с такой проверкой у тебя не будет отрабатывать validateBeforeUpload, даже если он есть

@unknownproperty unknownproperty merged commit 1eb3540 into main Dec 12, 2025
4 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.

3 participants