@@ -37,14 +37,14 @@ class NavBarContainer extends Component {
3737 const inputName = document . querySelector ( '#collectionNameInput' ) . value ;
3838 if ( ! ! inputName . trim ( ) ) {
3939 collectionsController . collectionNameExists ( { name : inputName } )
40- . catch ( ( err ) => console . log ( "error in checking collection name: " , err ) )
41- . then ( ( found ) => {
42- if ( found ) { //if the name already exists
43- document . querySelector ( '#collectionNameInput' ) . setAttribute ( "style" , "border-color: red;" ) ;
44- document . querySelector ( '#collectionNameError' ) . setAttribute ( "style" , "display: block" ) ;
45- }
46- else this . saveCollection ( inputName )
47- } )
40+ . catch ( ( err ) => console . error ( "error in checking collection name: " , err ) )
41+ . then ( ( found ) => {
42+ if ( found ) { //if the name already exists
43+ document . querySelector ( '#collectionNameInput' ) . setAttribute ( "style" , "border-color: red;" ) ;
44+ document . querySelector ( '#collectionNameError' ) . setAttribute ( "style" , "display: block" ) ;
45+ }
46+ else this . saveCollection ( inputName )
47+ } )
4848 }
4949 }
5050 saveCollection ( inputName ) {
@@ -56,12 +56,12 @@ class NavBarContainer extends Component {
5656 reqRes . timeReceived = null ;
5757 reqRes . connection = 'uninitialized' ;
5858 if ( reqRes . response . hasOwnProperty ( 'headers' ) ) reqRes . response = { headers : null , events : null }
59- else reqRes . response = { messages : [ ] }
59+ else reqRes . response = { messages : [ ] }
6060 } ) ;
6161 const collectionObj = {
6262 name : inputName ,
6363 id : uuid ( ) ,
64- created_at : new Date ( ) ,
64+ created_at : new Date ( ) ,
6565 reqResArray : clonedArray
6666 }
6767 collectionsController . addCollectionToIndexedDb ( collectionObj ) ; //add to IndexedDB
@@ -127,8 +127,8 @@ class NavBarContainer extends Component {
127127 } }
128128 >
129129 < h1 id = "heading" > What would you like to name your collection?</ h1 >
130- < input type = { 'text' } id = "collectionNameInput" onKeyDown = { ( e ) => this . handleKeyPress ( e ) } autoFocus />
131- < p id = "collectionNameError" style = { { display :'none' } } > Collection name already exists!</ p >
130+ < input type = { 'text' } id = "collectionNameInput" onKeyDown = { ( e ) => this . handleKeyPress ( e ) } autoFocus />
131+ < p id = "collectionNameError" style = { { display : 'none' } } > Collection name already exists!</ p >
132132 < div >
133133 < button onClick = { this . saveName } > Save</ button >
134134 < button onClick = { this . handleCloseModal } > Cancel</ button >
0 commit comments