Skip to content

Commit e8553ca

Browse files
committed
Make finder work fine
1 parent 044e6b7 commit e8553ca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

browser/finder/NoteDetail.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@ class NoteDetail extends React.Component {
106106
let editorIndentSize = parseInt(config.editor.indentSize, 10)
107107
if (!(editorFontSize > 0 && editorFontSize < 132)) editorIndentSize = 4
108108

109+
const cachedStorageList = JSON.parse(localStorage.getItem('storages'))
110+
if (!_.isArray(cachedStorageList)) throw new Error('Target storage doesn\'t exist.')
111+
const storage = _.find(cachedStorageList, {key: note.storage})
112+
if (storage === undefined) throw new Error('Target storage doesn\'t exist.')
113+
109114
if (note.type === 'SNIPPET_NOTE') {
110115
let tabList = note.snippets.map((snippet, index) => {
111116
let isActive = this.state.snippetIndex === index
@@ -192,6 +197,7 @@ class NoteDetail extends React.Component {
192197
lineNumber={config.preview.lineNumber}
193198
indentSize={editorIndentSize}
194199
value={note.content}
200+
storagePath={storage.path}
195201
/>
196202
)
197203
}

0 commit comments

Comments
 (0)