From 6cf92800e8cf58a165789427d9acf7748b22ad41 Mon Sep 17 00:00:00 2001 From: Mo Bitar Date: Sun, 24 Jun 2018 18:21:58 -0500 Subject: [PATCH] Notify observers of tag association without waiting for sync --- app/assets/javascripts/app/controllers/editor.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/app/controllers/editor.js b/app/assets/javascripts/app/controllers/editor.js index aba2705c3..922c9cbd4 100644 --- a/app/assets/javascripts/app/controllers/editor.js +++ b/app/assets/javascripts/app/controllers/editor.js @@ -532,12 +532,20 @@ angular.module('app') if(data.item.content_type == "Tag") { var tag = modelManager.findItem(data.item.uuid); this.addTag(tag); + + // Currently extensions are not notified of association until a full server sync completes. + // We need a better system for this, but for now, we'll manually notify observers + modelManager.notifySyncObserversOfModels([this.note], ModelManager.MappingSourceLocalSaved); } } else if(action === "deassociate-item") { var tag = modelManager.findItem(data.item.uuid); this.removeTag(tag); + + // Currently extensions are not notified of association until a full server sync completes. + // We need a better system for this, but for now, we'll manually notify observers + modelManager.notifySyncObserversOfModels([this.note], ModelManager.MappingSourceLocalSaved); } else if(action === "save-items" || action === "save-success" || action == "save-error") {