Преглед изворни кода

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 пре 9 година
родитељ
комит
074c8d6
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

+ 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())