Browse Source

HUE-3709 [editor] Close the previous query correctly if needed

We were reseting the result before checking fetchedOnce() so never going in the if.
Romain Rigaux 10 năm trước cách đây
mục cha
commit
074c8d6

+ 5 - 5
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -580,6 +580,11 @@
       $(".jHueNotify").hide();
       logGA('execute/' + self.type());
 
+      if (self.result.fetchedOnce()) {
+        self.close();
+        self.statusForButtons('executed');
+      }
+
       self.status('running');
       self.statusForButtons('executing');
       self.errors([]);
@@ -600,11 +605,6 @@
 
       self.currentQueryTab('queryHistory');
 
-      if (self.result.fetchedOnce()) {
-        self.close();
-        self.statusForButtons('executed');
-      }
-
       $.post("/notebook/api/execute", {
         notebook: vm.editorMode ? ko.mapping.toJSON(notebook, NOTEBOOK_MAPPING) : ko.mapping.toJSON(notebook.getContext()),
         snippet: ko.mapping.toJSON(self.getContext())