瀏覽代碼

HUE-4569 [editor] If we don't have a query history select the saved query tab

Minor side effect is when we clear the query history it will switch to the saved query tab.
Romain Rigaux 10 年之前
父節點
當前提交
7490137d95
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

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

@@ -1282,6 +1282,11 @@
       self.coordinatorUuid(self.dependentsCoordinator()[0].uuid());
     }
     self.history = ko.observableArray(vm.selectedNotebook() ? vm.selectedNotebook().history() : []);
+    self.history.subscribe(function(val) {
+      if (self.id() == null && val.length == 0) {
+        self.snippets()[0].currentQueryTab('savedQueries');
+      }
+    });
     self.historyFilter = ko.observable('');
     self.historyFilterVisible = ko.observable(false);
     self.historyFilter.extend({ rateLimit: 300 });