@@ -7,7 +7,6 @@ import {FileElement} from 'jsx/Form';
7
7
8
8
/**
9
9
* Render a modal window for adding a filter
10
- *
11
10
* @param {object } props - React props
12
11
* @param {function } props.setQuery - Function to set the current criteria
13
12
* @param {function } props.closeModal - Callback to close the current modal
@@ -23,7 +22,6 @@ function ImportCSVModal(props: {
23
22
const [ idType , setIdType ] = useState < string > ( 'PSCID' ) ;
24
23
/**
25
24
* Promise for handling modal closing. Always accepts.
26
- *
27
25
* @returns {Promise } - a stub promise
28
26
*/
29
27
const submitPromise = ( ) =>
@@ -36,7 +34,6 @@ function ImportCSVModal(props: {
36
34
37
35
/**
38
36
* Callback function for after papaparse has parsed the csv
39
- *
40
37
* @param {any } value - the value from papaparse callback
41
38
*/
42
39
const csvParsed = ( value : Papa . ParseResult < any > ) => {
@@ -53,6 +50,7 @@ function ImportCSVModal(props: {
53
50
// If sessions: validate 2 columns
54
51
const expectedLength = ( csvType === 'session' ? 2 : 1 ) ;
55
52
const startLine = csvHeader ? 1 : 0 ;
53
+
56
54
for ( let i = startLine ; i < value . data . length ; i ++ ) {
57
55
if ( value . data [ i ] . length != expectedLength ) {
58
56
swal . fire ( {
@@ -73,6 +71,7 @@ function ImportCSVModal(props: {
73
71
+ ') on line '
74
72
+ ( i + 1 ) + '.' ,
75
73
} ) ;
74
+ return ;
76
75
}
77
76
}
78
77
}
0 commit comments