mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
recent notes are reloaded if synced
This commit is contained in:
parent
28bc443914
commit
34f1eb930c
@ -11,9 +11,11 @@ const recentNotes = (function() {
|
|||||||
// list of recent note paths
|
// list of recent note paths
|
||||||
let list = [];
|
let list = [];
|
||||||
|
|
||||||
server.get('recent-notes').then(result => {
|
async function reload() {
|
||||||
|
const result = await server.get('recent-notes');
|
||||||
|
|
||||||
list = result.map(r => r.note_path);
|
list = result.map(r => r.note_path);
|
||||||
});
|
}
|
||||||
|
|
||||||
function addRecentNote(noteTreeId, notePath) {
|
function addRecentNote(noteTreeId, notePath) {
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
@ -127,6 +129,8 @@ const recentNotes = (function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
reload();
|
||||||
|
|
||||||
$(document).bind('keydown', 'alt+q', showDialog);
|
$(document).bind('keydown', 'alt+q', showDialog);
|
||||||
|
|
||||||
selectBoxEl.dblclick(e => {
|
selectBoxEl.dblclick(e => {
|
||||||
@ -140,6 +144,7 @@ const recentNotes = (function() {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
showDialog,
|
showDialog,
|
||||||
addRecentNote
|
addRecentNote,
|
||||||
|
reload
|
||||||
};
|
};
|
||||||
})();
|
})();
|
@ -33,6 +33,12 @@ const messaging = (function() {
|
|||||||
noteEditor.reload();
|
noteEditor.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.recent_notes) {
|
||||||
|
console.log("Reloading recent notes because of background changes");
|
||||||
|
|
||||||
|
recentNotes.reload();
|
||||||
|
}
|
||||||
|
|
||||||
const changesToPushCountEl = $("#changesToPushCount");
|
const changesToPushCountEl = $("#changesToPushCount");
|
||||||
changesToPushCountEl.html(message.changesToPushCount);
|
changesToPushCountEl.html(message.changesToPushCount);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user