File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
packages/frontend/src/components/AttachmentSuggestions Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ function AttachmentSuggestions(props: AttachmentSuggestionsProps) {
9595 if ( ! checked ) {
9696 onChange ?.( currentValues . filter ( ( v : string ) => v !== nameToCheck ) )
9797 } else {
98- const { isValid, error } = validateFiles ( variable , getValues ( name ) )
98+ const { isValid, error } = validateFiles ( variable , currentValues )
9999 if ( ! isValid ) {
100100 setError ( name , { type : 'invalidFile' , message : error } )
101101 } else {
Original file line number Diff line number Diff line change @@ -174,10 +174,10 @@ export function validateFiles(
174174 const totalSize = currentTotalSize + fileSize
175175 const currentFileCount = selectedOptions . length + 1
176176
177- if ( currentFileCount >= MAX_NUM_FILES ) {
177+ if ( currentFileCount > MAX_NUM_FILES ) {
178178 return {
179179 isValid : false ,
180- error : 'Total number of files exceeds 10' ,
180+ error : 'Total number of files cannot exceed 10' ,
181181 }
182182 }
183183 if ( fileSize > MAX_FILE_SIZE ) {
You can’t perform that action at this time.
0 commit comments