mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fixed recent list for cloned notes
This commit is contained in:
parent
c23928d070
commit
d1ed730b54
@ -161,25 +161,25 @@ function loadNote(noteId) {
|
|||||||
|
|
||||||
$(window).resize(); // to trigger resizing of editor
|
$(window).resize(); // to trigger resizing of editor
|
||||||
|
|
||||||
addRecentNote(noteId, note.detail.note_title);
|
addRecentNote(noteId, note.detail.note_id, note.detail.note_title);
|
||||||
|
|
||||||
noteChangeDisabled = false;
|
noteChangeDisabled = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRecentNote(noteId, noteTitle) {
|
function addRecentNote(noteTreeId, noteContentId, noteTitle) {
|
||||||
const origDate = new Date();
|
const origDate = new Date();
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
// we include the note into recent list only if the user stayed on the note at least 5 seconds
|
// we include the note into recent list only if the user stayed on the note at least 5 seconds
|
||||||
if (noteId === globalNote.detail.note_id) {
|
if (noteTreeId === globalNote.detail.note_id || noteContentId === globalNote.detail.note_id) {
|
||||||
// if it's already there, remove the note
|
// if it's already there, remove the note
|
||||||
recentNotes = recentNotes.filter(note => note.noteId !== noteId);
|
recentNotes = recentNotes.filter(note => note.noteId !== noteTreeId);
|
||||||
|
|
||||||
console.log("added after " + (new Date().getTime() - origDate.getTime()));
|
console.log("added after " + (new Date().getTime() - origDate.getTime()));
|
||||||
|
|
||||||
recentNotes.unshift({
|
recentNotes.unshift({
|
||||||
noteId: noteId,
|
noteId: noteTreeId,
|
||||||
noteTitle: noteTitle
|
noteTitle: noteTitle
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user