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

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 });