mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
reloading of notes in tree cache when attribute changes
This commit is contained in:
parent
b7b583ff04
commit
b471d51cb4
@ -8,9 +8,6 @@ const RELATION = 'relation';
|
|||||||
const RELATION_DEFINITION = 'relation-definition';
|
const RELATION_DEFINITION = 'relation-definition';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FIXME: rethink how attributes are cached in Note entities since they are long lived inside the cache.
|
|
||||||
* Attribute cache should be limited to "transaction".
|
|
||||||
*
|
|
||||||
* This note's representation is used in note tree and is kept in TreeCache.
|
* This note's representation is used in note tree and is kept in TreeCache.
|
||||||
*/
|
*/
|
||||||
class NoteShort {
|
class NoteShort {
|
||||||
|
@ -784,6 +784,14 @@ ws.subscribeToOutsideSyncMessages(async syncData => {
|
|||||||
|
|
||||||
syncData.filter(sync => sync.entityName === 'note_reordering').forEach(sync => noteIdsToRefresh.add(sync.entityId));
|
syncData.filter(sync => sync.entityName === 'note_reordering').forEach(sync => noteIdsToRefresh.add(sync.entityId));
|
||||||
|
|
||||||
|
syncData.filter(sync => sync.entityName === 'attributes').forEach(sync => {
|
||||||
|
const note = treeCache.notes[sync.noteId];
|
||||||
|
|
||||||
|
if (note && note.attributeCache) {
|
||||||
|
noteIdsToRefresh.add(sync.entityId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (noteIdsToRefresh.size > 0) {
|
if (noteIdsToRefresh.size > 0) {
|
||||||
await reloadNotes(Array.from(noteIdsToRefresh));
|
await reloadNotes(Array.from(noteIdsToRefresh));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user