Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix edited notes widget note transitions, fixes #1672
zadamddf8438b22b2
diff --git a/src/public/app/widgets/collapsible_widgets/edited_notes.js b/src/public/app/widgets/collapsible_widgets/edited_notes.jsindex b214ac17e1..3f6851e732 100644--- a/src/public/app/widgets/collapsible_widgets/edited_notes.js+++ b/src/public/app/widgets/collapsible_widgets/edited_notes.js@@ -12,6 +12,10 @@ const TPL = `text-overflow: ellipsis;}</style>++ <div class="no-edited-notes-found">No edited notes on this day yet ...</div>++ <div class="edited-notes-list"></div></div>`;@@ -31,18 +35,20 @@ export default class EditedNotesWidget extends CollapsibleWidget {async doRenderBody() {this.$body.html(TPL);- this.$editedNotes = this.$body.find('.edited-notes-widget');+ this.$list = this.$body.find('.edited-notes-list');+ this.$noneFound = this.$body.find('.no-edited-notes-found');}async refreshWithNote(note) {- // remember which title was when we found the similar notes- this.title = note.title;let editedNotes = await server.get('edited-notes/' + note.getLabelValue("dateNote"));editedNotes = editedNotes.filter(n => n.noteId !== note.noteId);+ this.$list.empty();+ this.$noneFound.hide();+if (editedNotes.length === 0) {- this.$body.text("No edited notes on this day yet ...");+ this.$noneFound.show();return;}@@ -50,8 +56,6 @@ export default class EditedNotesWidget extends CollapsibleWidget {await treeCache.getNotes(noteIds, true); // preload all at once- const $list = $('<div>'); // not using <ul> because it's difficult to style correctly with text-overflow-for (const editedNote of editedNotes) {const $item = $('<div class="edited-note-line">');@@ -67,9 +71,7 @@ export default class EditedNotesWidget extends CollapsibleWidget {$item.append(editedNote.notePath ? await linkService.createNoteLink(editedNote.notePath.join("/"), {showNotePath: true}) : editedNote.title);}- $list.append($item);+ this.$list.append($item);}-- this.$editedNotes.empty().append($list);}}diff --git a/src/services/search/search_result.js b/src/services/search/search_result.jsindex 9d0ea334a6..a354cfdb71 100644--- a/src/services/search/search_result.js+++ b/src/services/search/search_result.js@@ -19,6 +19,8 @@ class SearchResult {computeScore(tokens) {this.score = 0;+ // matches in attributes don't get extra points and thus are implicitly valued less than note path matches+const chunks = this.notePathTitle.toLowerCase().split(" ");for (const chunk of chunks) {diff --git a/src/services/sync.js b/src/services/sync.jsindex df926c77e4..9aad2e3e7f 100644--- a/src/services/sync.js+++ b/src/services/sync.js@@ -101,7 +101,7 @@ async function doLogin() {});if (sourceIdService.isLocalSourceId(resp.sourceId)) {- throw new Error(`Sync server has source ID ${resp.sourceId} which is also local. Your sync setup is probably trying to connect to itself.`);+ throw new Error(`Sync server has source ID ${resp.sourceId} which is also local. This usually happens when the sync client is (mis)configured to sync with itself (URL points back to client) instead of the correct sync server.`);}syncContext.sourceId = resp.sourceId;