Unverified Commit 51372d82 authored by aiwenmo's avatar aiwenmo Committed by GitHub

[fix-574] [web] fix datastudio->tabs close_other can not close first tab

[fix-574] [web] fix datastudio->tabs close_other can not close first tab
parents 5394abb2 912f7640
......@@ -360,16 +360,14 @@ const Model: ModelType = {
closeTabs(state, {payload}) {
const {deleteType, current} = payload;
const newTabs = state.tabs;
const firstKey = newTabs.panes[0].key;
let newCurrent = newTabs.panes[0];
if (deleteType == 'CLOSE_OTHER') {
const keys = [firstKey, current.key];
const keys = [current.key];
newCurrent = current;
newTabs.activeKey = current.key;
newTabs.panes = newTabs.panes.filter(item => keys.includes(item.key));
} else {
newTabs.panes = [];
newTabs.activeKey = firstKey
}
return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment