mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 18:05:55 +01:00
reloading tree now doesn't force note reload
This commit is contained in:
@@ -36,6 +36,20 @@ const noteEditor = (function() {
|
||||
isNoteChanged = true;
|
||||
}
|
||||
|
||||
async function reload() {
|
||||
// no saving here
|
||||
|
||||
await loadNoteToEditor(getCurrentNoteId());
|
||||
}
|
||||
|
||||
async function switchToNote(noteId) {
|
||||
if (getCurrentNoteId() !== noteId) {
|
||||
await saveNoteIfChanged();
|
||||
|
||||
await loadNoteToEditor(noteId);
|
||||
}
|
||||
}
|
||||
|
||||
async function saveNoteIfChanged() {
|
||||
if (!isNoteChanged) {
|
||||
return;
|
||||
@@ -247,6 +261,8 @@ const noteEditor = (function() {
|
||||
setInterval(saveNoteIfChanged, 5000);
|
||||
|
||||
return {
|
||||
reload,
|
||||
switchToNote,
|
||||
saveNoteIfChanged,
|
||||
updateNoteFromInputs,
|
||||
saveNoteToServer,
|
||||
|
||||
Reference in New Issue
Block a user