mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fix "getNoteStartingWith" relic
This commit is contained in:
		
							parent
							
								
									a810c08c02
								
							
						
					
					
						commit
						d9550dd59b
					
				| @ -56,8 +56,7 @@ function getYearNote(dateStr, rootNote) { | ||||
| 
 | ||||
|     const yearStr = dateStr.substr(0, 4); | ||||
| 
 | ||||
|     let yearNote = attributeService.getNoteWithLabel(YEAR_LABEL, yearStr) | ||||
|         || getNoteStartingWith(rootNote.noteId, yearStr); | ||||
|     let yearNote = attributeService.getNoteWithLabel(YEAR_LABEL, yearStr); | ||||
| 
 | ||||
|     if (yearNote) { | ||||
|         return yearNote; | ||||
| @ -103,18 +102,12 @@ function getMonthNote(dateStr, rootNote) { | ||||
|         return monthNote; | ||||
|     } | ||||
| 
 | ||||
|     const yearNote = getYearNote(dateStr, rootNote); | ||||
| 
 | ||||
|     monthNote = getNoteStartingWith(yearNote.noteId, monthNumber); | ||||
| 
 | ||||
|     if (monthNote) { | ||||
|         return monthNote; | ||||
|     } | ||||
| 
 | ||||
|     const dateObj = dateUtils.parseLocalDate(dateStr); | ||||
| 
 | ||||
|     const noteTitle = getMonthNoteTitle(rootNote, monthNumber, dateObj); | ||||
| 
 | ||||
|     const yearNote = getYearNote(dateStr, rootNote); | ||||
| 
 | ||||
|     sql.transactional(() => { | ||||
|         monthNote = createNote(yearNote, noteTitle); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam