mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fix(build): build errors after changing meta data type
This commit is contained in:
		
							parent
							
								
									94ce01bbc2
								
							
						
					
					
						commit
						4e876ed24d
					
				| @ -407,6 +407,10 @@ ${markdownContent}`; | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function saveNavigation(rootMeta: NoteMeta, navigationMeta: NoteMeta) { |     function saveNavigation(rootMeta: NoteMeta, navigationMeta: NoteMeta) { | ||||||
|  |         if (!navigationMeta.dataFileName) { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         function saveNavigationInner(meta: NoteMeta) { |         function saveNavigationInner(meta: NoteMeta) { | ||||||
|             let html = "<li>"; |             let html = "<li>"; | ||||||
| 
 | 
 | ||||||
| @ -451,6 +455,10 @@ ${markdownContent}`; | |||||||
|         let firstNonEmptyNote; |         let firstNonEmptyNote; | ||||||
|         let curMeta = rootMeta; |         let curMeta = rootMeta; | ||||||
| 
 | 
 | ||||||
|  |         if (!indexMeta.dataFileName) { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         while (!firstNonEmptyNote) { |         while (!firstNonEmptyNote) { | ||||||
|             if (curMeta.dataFileName && curMeta.noteId) { |             if (curMeta.dataFileName && curMeta.noteId) { | ||||||
|                 firstNonEmptyNote = getNoteTargetUrl(curMeta.noteId, rootMeta); |                 firstNonEmptyNote = getNoteTargetUrl(curMeta.noteId, rootMeta); | ||||||
| @ -479,6 +487,10 @@ ${markdownContent}`; | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     function saveCss(rootMeta: NoteMeta, cssMeta: NoteMeta) { |     function saveCss(rootMeta: NoteMeta, cssMeta: NoteMeta) { | ||||||
|  |         if (!cssMeta.dataFileName) { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         const cssContent = fs.readFileSync(`${RESOURCE_DIR}/libraries/ckeditor/ckeditor-content.css`); |         const cssContent = fs.readFileSync(`${RESOURCE_DIR}/libraries/ckeditor/ckeditor-content.css`); | ||||||
| 
 | 
 | ||||||
|         archive.append(cssContent, { name: cssMeta.dataFileName }); |         archive.append(cssContent, { name: cssMeta.dataFileName }); | ||||||
|  | |||||||
| @ -304,19 +304,16 @@ describe("#getNoteTitle", () => { | |||||||
|         ], |         ], | ||||||
|         [ |         [ | ||||||
|           "when a noteMeta object is passed, it should use the title from the noteMeta, if present", |           "when a noteMeta object is passed, it should use the title from the noteMeta, if present", | ||||||
|           //@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here
 |  | ||||||
|           ["test_file.md", true, { title: "some other title"}], |           ["test_file.md", true, { title: "some other title"}], | ||||||
|           "some other title" |           "some other title" | ||||||
|         ], |         ], | ||||||
|         [ |         [ | ||||||
|           "when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed", |           "when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed", | ||||||
|           //@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here
 |  | ||||||
|           ["test_file.md", true, { title: ""}], |           ["test_file.md", true, { title: ""}], | ||||||
|           "test file" |           "test file" | ||||||
|         ], |         ], | ||||||
|         [ |         [ | ||||||
|             "when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed", |             "when a noteMeta object is passed, but the title prop is empty, it should try to handle the filename as if no noteMeta was passed", | ||||||
|             //@ts-expect-error - passing in incomplete noteMeta - but we only care about the title prop here
 |  | ||||||
|             ["test_file.json", false, { title: " "}], |             ["test_file.json", false, { title: " "}], | ||||||
|             "test_file.json" |             "test_file.json" | ||||||
|         ] |         ] | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user