mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
widgets can now listen to sync data changes
This commit is contained in:
@@ -357,13 +357,14 @@ function fireDetailLoaded() {
|
||||
detailLoadedListeners = [];
|
||||
}
|
||||
|
||||
messagingService.subscribeToSyncMessages(syncData => {
|
||||
messagingService.subscribeToOutsideSyncMessages(syncData => {
|
||||
const noteIdsToRefresh = new Set();
|
||||
|
||||
syncData
|
||||
.filter(sync => sync.entityName === 'notes')
|
||||
.forEach(sync => noteIdsToRefresh.add(sync.entityId));
|
||||
|
||||
// we need to reload because of promoted attributes
|
||||
syncData
|
||||
.filter(sync => sync.entityName === 'attributes')
|
||||
.forEach(sync => noteIdsToRefresh.add(sync.noteId));
|
||||
@@ -373,6 +374,12 @@ messagingService.subscribeToSyncMessages(syncData => {
|
||||
}
|
||||
});
|
||||
|
||||
messagingService.subscribeToAllSyncMessages(syncData => {
|
||||
for (const tc of tabContexts) {
|
||||
tc.syncDataReceived(syncData);
|
||||
}
|
||||
});
|
||||
|
||||
$tabContentsContainer.on("dragover", e => e.preventDefault());
|
||||
|
||||
$tabContentsContainer.on("dragleave", e => e.preventDefault());
|
||||
|
||||
Reference in New Issue
Block a user