Fixes issue where selecting an editor for a note on one platform doesn't update the live session on another platform

This commit is contained in:
Mo Bitar
2018-05-03 18:57:42 -05:00
parent a743cdc5c6
commit 45132f21d1
2 changed files with 21 additions and 2 deletions

View File

@@ -134,7 +134,7 @@ class ModelManager {
delete json_obj[key];
}
}
var item = this.findItem(json_obj.uuid);
if(item) {
@@ -193,7 +193,7 @@ class ModelManager {
/* Note that this function is public, and can also be called manually (desktopManager uses it) */
notifySyncObserversOfModels(models, source) {
for(var observer of this.itemSyncObservers) {
var allRelevantItems = models.filter(function(item){return item.content_type == observer.type || observer.type == "*"});
var allRelevantItems = observer.type == "*" ? models : models.filter(function(item){return item.content_type == observer.type});
var validItems = [], deletedItems = [];
for(var item of allRelevantItems) {
if(item.deleted) {