[editor] Reset the history if the type of the editor changed
If not, if default editor is hive and we open
the Hive history will stay instead of the Impala one.
@@ -1753,7 +1753,7 @@ var EditorViewModel = (function() {
if (self.dependentsCoordinator().length > 0 && ! self.coordinatorUuid()) {
self.coordinatorUuid(self.dependentsCoordinator()[0].uuid());
}
- self.history = ko.observableArray(vm.selectedNotebook() && vm.selectedNotebook().type() == self.type() ? vm.selectedNotebook().history() : []);
+ self.history = ko.observableArray(vm.selectedNotebook() && vm.selectedNotebook().history().length > 0 && vm.selectedNotebook().history()[0].type == self.type() ? vm.selectedNotebook().history() : []);
self.history.subscribe(function(val) {
if (self.id() == null && val.length == 0 && self.historyFilter() === '' && ! vm.isNotificationManager()) {
self.snippets()[0].currentQueryTab('savedQueries');
