Ver Fonte

HUE-3772 [editor] Browsing running queries might double the results

Enrico Berti há 9 anos atrás
pai
commit
f584cd5

+ 4 - 0
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1654,6 +1654,10 @@
     };
 
     self.loadNotebook = function (notebook) {
+      if (self.checkStatusTimeout != null) {
+        clearTimeout(self.checkStatusTimeout);
+        self.checkStatusTimeout = null;
+      }
       var notebook = new Notebook(self, notebook);
       if (notebook.snippets().length > 0) {
         notebook.selectedSnippet(notebook.snippets()[notebook.snippets().length - 1].type());

+ 4 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -3077,7 +3077,10 @@ ${ hueIcons.symbols() }
             else {
               _dt = _el.dataTable();
             }
-            _dt.fnAddData(options.data);
+            try {
+              _dt.fnAddData(options.data);
+            }
+            catch (e) {}
             var _dtElement = $("#snippet_" + options.snippet.id()).find(".dataTables_wrapper");
             _dtElement.animate({opacity: '1'}, 50);
             _dtElement.scrollTop(_dtElement.data("scrollPosition"));