mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-05-22 22:18:25 -05:00
similar notes is getting updated automatically after the title change
This commit is contained in:
@@ -267,9 +267,11 @@ class Attributes {
|
||||
}
|
||||
}
|
||||
|
||||
syncDataReceived(syncData) {
|
||||
if (syncData.find(sd => sd.entityName === 'attributes' && sd.noteId === this.ctx.note.noteId)) {
|
||||
this.reloadAttributes();
|
||||
eventReceived(name, data) {
|
||||
if (name === 'syncData') {
|
||||
if (data.find(sd => sd.entityName === 'attributes' && sd.noteId === this.ctx.note.noteId)) {
|
||||
this.reloadAttributes();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ ws.subscribeToOutsideSyncMessages(syncData => {
|
||||
|
||||
ws.subscribeToAllSyncMessages(syncData => {
|
||||
for (const tc of tabContexts) {
|
||||
tc.syncDataReceived(syncData);
|
||||
tc.eventReceived('syncData', syncData);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ class Sidebar {
|
||||
}
|
||||
}
|
||||
|
||||
syncDataReceived(syncData) {
|
||||
eventReceived(name, data) {
|
||||
for (const widget of this.widgets) {
|
||||
if (widget.syncDataReceived) {
|
||||
widget.syncDataReceived(syncData);
|
||||
if (widget.eventReceived) {
|
||||
widget.eventReceived(name, data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,6 +267,8 @@ class TabContext {
|
||||
|
||||
// run async
|
||||
bundleService.executeRelationBundles(this.note, 'runOnNoteChange', this);
|
||||
|
||||
this.eventReceived('noteSaved');
|
||||
}
|
||||
|
||||
async saveNoteIfChanged() {
|
||||
@@ -366,11 +368,11 @@ class TabContext {
|
||||
}
|
||||
}
|
||||
|
||||
syncDataReceived(syncData) {
|
||||
this.attributes.syncDataReceived(syncData);
|
||||
eventReceived(name, data) {
|
||||
this.attributes.eventReceived(name, data);
|
||||
|
||||
if (this.sidebar) {
|
||||
this.sidebar.syncDataReceived(syncData);
|
||||
this.sidebar.eventReceived(name, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user