File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
ts/dataImport/importers/characterBoxes Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 114114 ' type' : ' error' ,
115115 ' title' : ' File Upload'
116116 } );
117- else console .error ( error );
117+ else {
118+ console .error ( error );
119+ notifications .notify ( {
120+ ' text' : ' An unknown error occurred. See console for more information' ,
121+ ' type' : ' error' ,
122+ ' title' : ' File Upload'
123+ } );
124+ }
118125
119126 uploading .value = false ;
120127
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ export const characterBoxMultipleTextImporter: ImportConfig<ImportCharacterBound
3333 if ( ! inputElement . files || ! inputElement . files [ 0 ] ) throw new MissingFilesError ( ) ;
3434
3535 return runParse ( await fileLoaderString ( inputElement . files [ 0 ] ) , textId ) ;
36+ } ,
37+ 'canParse' : ( header : string [ ] ) => {
38+ return header . includes ( 'text' ) ;
3639 }
3740} ;
3841
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ export const characterBoxSingleTextImporter: ImportConfig<ImportCharacterBoundin
2424 if ( ! inputElement . files || ! inputElement . files [ 0 ] ) throw new MissingFilesError ( ) ;
2525
2626 return runParse ( await fileLoaderString ( inputElement . files [ 0 ] ) ) ;
27+ } ,
28+ 'canParse' : ( header : string [ ] ) => {
29+ return ! header . includes ( 'text' ) ;
2730 }
2831} ;
2932
You can’t perform that action at this time.
0 commit comments