mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	Merge pull request #3288 from eliandoran/feature/filter_edited_notes_when_hoisted
Filter "Edited notes" when hoisted or in a workspace
This commit is contained in:
		| @@ -5,6 +5,7 @@ const protectedSessionService = require('../../services/protected_session'); | |||||||
| const noteRevisionService = require('../../services/note_revisions'); | const noteRevisionService = require('../../services/note_revisions'); | ||||||
| const utils = require('../../services/utils'); | const utils = require('../../services/utils'); | ||||||
| const sql = require('../../services/sql'); | const sql = require('../../services/sql'); | ||||||
|  | const cls = require('../../services/cls'); | ||||||
| const path = require('path'); | const path = require('path'); | ||||||
| const becca = require("../../becca/becca"); | const becca = require("../../becca/becca"); | ||||||
|  |  | ||||||
| @@ -124,8 +125,15 @@ function getEditedNotesOnDate(req) { | |||||||
|         ORDER BY isDeleted |         ORDER BY isDeleted | ||||||
|         LIMIT 50`, {date: req.params.date + '%'}); |         LIMIT 50`, {date: req.params.date + '%'}); | ||||||
|  |  | ||||||
|     const notes = becca.getNotes(noteIds, true) |     let notes = becca.getNotes(noteIds, true); | ||||||
|         .map(note => note.getPojo()); |  | ||||||
|  |     // Narrow down the results if a note is hoisted, similar to "Jump to note". | ||||||
|  |     const hoistedNoteId = cls.getHoistedNoteId(); | ||||||
|  |     if (hoistedNoteId) { | ||||||
|  |         notes = notes.filter(note => note.hasAncestor(hoistedNoteId)); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     notes = notes.map(note => note.getPojo()); | ||||||
|  |  | ||||||
|     for (const note of notes) { |     for (const note of notes) { | ||||||
|         const notePath = note.isDeleted ? null : beccaService.getNotePath(note.noteId); |         const notePath = note.isDeleted ? null : beccaService.getNotePath(note.noteId); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user