File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments