mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fix for non-sync WS messages
This commit is contained in:
@@ -19,14 +19,14 @@ const messaging = (function() {
|
||||
function messageHandler(event) {
|
||||
const message = JSON.parse(event.data);
|
||||
|
||||
if (message.data.length > 0) {
|
||||
console.log(message);
|
||||
}
|
||||
|
||||
if (message.type === 'sync') {
|
||||
lastPingTs = new Date().getTime();
|
||||
const syncData = message.data.filter(sync => sync.source_id !== glob.sourceId);
|
||||
|
||||
if (syncData.length > 0) {
|
||||
console.log("Sync data: ", message);
|
||||
}
|
||||
|
||||
if (syncData.some(sync => sync.entity_name === 'notes_tree')) {
|
||||
console.log("Reloading tree because of background changes");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user