Commit e76e7b0e authored by zhu-mingye's avatar zhu-mingye

fix tabs close_other can not close first tab

parent f57b3157
......@@ -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