Merge pull request #180 from dbeaver/fix/sql-editor-no-tabs-placeholder

fix(plugin-sql-editor): CB-358 no active tabs placeholder message
This commit is contained in:
Alexey
2020-10-13 16:17:12 +03:00
committed by GitHub
@@ -132,11 +132,21 @@ export class SqlEditorNavigatorService {
if (data.type === SQLEditorNavigationAction.select) {
tab.handlerState.currentResultTabId = data.resultId;
} else if (data.type === SQLEditorNavigationAction.close) {
const resultTabGroupId = tab.handlerState.resultTabs
.find(resultTab => resultTab.resultTabId === data.resultId)?.groupId;
tab.handlerState.resultTabs.splice(
tab.handlerState.resultTabs.findIndex(result => result.resultTabId === data.resultId),
1
);
const isGroupEmpty = !tab.handlerState.resultTabs.some(resultTab => resultTab.groupId === resultTabGroupId);
if (isGroupEmpty) {
tab.handlerState.queryTabGroups.splice(
tab.handlerState.queryTabGroups.findIndex(queryTabGroup => queryTabGroup.groupId === resultTabGroupId), 1);
}
if (tab.handlerState.currentResultTabId === data.resultId) {
if (tab.handlerState.resultTabs.length > 0) {
tab.handlerState.currentResultTabId = tab.handlerState.resultTabs[0].resultTabId;