@@ -567,7 +567,7 @@ export function* persistenceSaga(): SagaIterator {
567
567
title : 'Saving to Google Drive' ,
568
568
contents : (
569
569
< span >
570
- Folder with the same name was found. Overwrite < strong > { topLevelFolderName } </ strong > ?
570
+ Overwrite < strong > { topLevelFolderName } </ strong > inside < strong > { saveToDir . name } </ strong > ?
571
571
No deletions will be made remotely, only content updates, but new remote files may be created.
572
572
</ span >
573
573
)
@@ -680,11 +680,7 @@ export function* persistenceSaga(): SagaIterator {
680
680
const persistenceFileArray : PersistenceFile [ ] = yield select ( ( state : OverallState ) => state . fileSystem . persistenceFileArray ) ;
681
681
for ( const currFullFilePath of Object . keys ( currFiles ) ) {
682
682
const currFileContent = currFiles [ currFullFilePath ] ;
683
- const regexResult = / ^ ( .* [ \\ \/ ] ) ? ( \. * .* ?) ( \. [ ^ . ] + ?| ) $ / . exec ( currFullFilePath ) ;
684
- if ( regexResult === null ) {
685
- yield call ( console . log , "Regex null!" ) ;
686
- continue ;
687
- }
683
+ const regexResult = / ^ ( .* [ \\ \/ ] ) ? ( \. * .* ?) ( \. [ ^ . ] + ?| ) $ / . exec ( currFullFilePath ) ! ;
688
684
const currFileName = regexResult [ 2 ] + regexResult [ 3 ] ;
689
685
//const currFileParentFolders: string[] = regexResult[1].slice(
690
686
// ("/playground/" + currFolderObject.name + "/").length, -1)
@@ -696,14 +692,12 @@ export function* persistenceSaga(): SagaIterator {
696
692
697
693
const currPersistenceFile = persistenceFileArray . find ( e => e . path === currFullFilePath ) ;
698
694
if ( currPersistenceFile === undefined ) {
699
- yield call ( console . log , "this file is not in persistenceFileArray: " , currFullFilePath ) ; // TODO change to Error?
700
- continue ;
695
+ throw new Error ( "this file is not in persistenceFileArray: " + currFullFilePath ) ;
701
696
}
702
697
703
698
if ( ! currPersistenceFile . id || ! currPersistenceFile . parentId ) {
704
699
// get folder
705
- yield call ( console . log , "this file does not have id/parentId: " , currFullFilePath ) ; // TODO change to Error?
706
- continue ;
700
+ throw new Error ( "this file does not have id/parentId: " + currFullFilePath ) ;
707
701
}
708
702
709
703
const currFileId = currPersistenceFile . id ! ;
0 commit comments