mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	fix storing dateLastEdited timestamp in note revisions
This commit is contained in:
		
							parent
							
								
									032ffa8367
								
							
						
					
					
						commit
						b0bf88c487
					
				| @ -105,6 +105,7 @@ class Note extends Entity { | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** @returns {{contentLength, dateModified, utcDateModified}} */ | ||||
|     getContentMetadata() { | ||||
|         return sql.getRow(` | ||||
|             SELECT  | ||||
|  | ||||
| @ -30,6 +30,8 @@ function createNoteRevision(note) { | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     const contentMetadata = note.getContentMetadata(); | ||||
| 
 | ||||
|     const noteRevision = new NoteRevision({ | ||||
|         noteId: note.noteId, | ||||
|         // title and text should be decrypted now
 | ||||
| @ -37,10 +39,14 @@ function createNoteRevision(note) { | ||||
|         type: note.type, | ||||
|         mime: note.mime, | ||||
|         isProtected: false, // will be fixed in the protectNoteRevisions() call
 | ||||
|         utcDateLastEdited: note.utcDateModified, | ||||
|         utcDateLastEdited: note.utcDateModified > contentMetadata.utcDateModified | ||||
|             ? note.utcDateModified | ||||
|             : contentMetadata.utcDateModified, | ||||
|         utcDateCreated: dateUtils.utcNowDateTime(), | ||||
|         utcDateModified: dateUtils.utcNowDateTime(), | ||||
|         dateLastEdited: note.dateModified, | ||||
|         dateLastEdited: note.dateModified > contentMetadata.dateModified | ||||
|             ? note.dateModified | ||||
|             : contentMetadata.dateModified, | ||||
|         dateCreated: dateUtils.localNowDateTime() | ||||
|     }).save(); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam