mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix note_reordering not updating note cache
This commit is contained in:
		| @@ -135,6 +135,10 @@ function getTree(req) { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     if (!(subTreeNoteId in noteCache.notes)) { | ||||||
|  |         return [404, `Note ${subTreeNoteId} not found in the cache`]; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     collect(noteCache.notes[subTreeNoteId]); |     collect(noteCache.notes[subTreeNoteId]); | ||||||
|  |  | ||||||
|     return getNotesAndBranchesAndAttributes(collectedNoteIds); |     return getNotesAndBranchesAndAttributes(collectedNoteIds); | ||||||
|   | |||||||
| @@ -5,6 +5,7 @@ const repository = require('./repository'); | |||||||
| const Branch = require('../entities/branch'); | const Branch = require('../entities/branch'); | ||||||
| const entityChangesService = require('./entity_changes.js'); | const entityChangesService = require('./entity_changes.js'); | ||||||
| const protectedSessionService = require('./protected_session'); | const protectedSessionService = require('./protected_session'); | ||||||
|  | const noteCache = require('./note_cache/note_cache'); | ||||||
|  |  | ||||||
| function getNotes(noteIds) { | function getNotes(noteIds) { | ||||||
|     // we return also deleted notes which have been specifically asked for |     // we return also deleted notes which have been specifically asked for | ||||||
| @@ -134,6 +135,8 @@ function sortNotesAlphabetically(parentNoteId, directoriesFirst = false) { | |||||||
|             sql.execute("UPDATE branches SET notePosition = ? WHERE branchId = ?", |             sql.execute("UPDATE branches SET notePosition = ? WHERE branchId = ?", | ||||||
|                 [position, note.branchId]); |                 [position, note.branchId]); | ||||||
|  |  | ||||||
|  |             noteCache.branches[note.branchId].notePosition = position; | ||||||
|  |  | ||||||
|             position += 10; |             position += 10; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user