[assist] Only refresh the docs assist when saving new documents in the editor
@@ -2202,7 +2202,7 @@ var EditorViewModel = (function() {
};
};
- self.save = function () {
+ self.save = function (callback) {
hueAnalytics.log('notebook', 'save');
// Remove the result data from the snippets
@@ -2262,9 +2262,10 @@ var EditorViewModel = (function() {
vm.changeURL('/notebook/notebook?notebook=' + data.id);
}
}
- huePubSub.publish('assist.document.refresh');
+ if (callback) {
+ callback();
}
- else {
+ } else {
$(document).trigger("error", data.message);
}
}).fail(function (xhr, textStatus, errorThrown) {
@@ -3101,7 +3102,9 @@ var EditorViewModel = (function() {
self.selectedNotebook().id(null);
self.selectedNotebook().uuid(UUID());
self.selectedNotebook().parentSavedQueryUuid(null);
- self.saveNotebook();
+ self.selectedNotebook().save(function () {
+ huePubSub.publish('assist.document.refresh');
+ });
};
}
