From 21220f93b16c4028a8165ec35d1e48d0eb2ff582 Mon Sep 17 00:00:00 2001 From: yosmoc Date: Sat, 4 Nov 2017 22:32:30 +0100 Subject: [PATCH] enable importing file to empty folder Current implementation is fetching the import destination storageKey and folderkey from a file in the folder. If no files are in the folder, it cannot fetch these keys. Use prop.params.storageKey / folderKey instead. --- browser/main/NoteList/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js index c9e116d7..fd4cb043 100644 --- a/browser/main/NoteList/index.js +++ b/browser/main/NoteList/index.js @@ -434,10 +434,8 @@ class NoteList extends React.Component { addNotesFromFiles (filepaths) { const { dispatch, location } = this.props - const targetIndex = this.getTargetIndex() - - const storageKey = this.notes[targetIndex].storage - const folderKey = this.notes[targetIndex].folder + const storageKey = this.props.params.storageKey + const folderKey = this.props.params.folderKey if (filepaths === undefined) return filepaths.forEach((filepath) => {