فهرست منبع

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 سال پیش
والد
کامیت
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())