From 5423c7caa9723e0b232ea6c5ef4aaf90bd7a3334 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 21 十月 2020 14:46:25 +0800 Subject: [PATCH] 2020-10-21 --- src/tabviews/zshare/actionList/tabbutton/index.jsx | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index ccd4e50..33964c5 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -117,29 +117,28 @@ } let index = 0 - let isexit = false - let tabs = tabviews.map((tab, i) => { + let tabs = tabviews.filter((tab, i) => { tab.selected = false if (tab.MenuID === MenuID) { index = i - } else if (tab.MenuID === btn.uuid) { - tab.selected = true - isexit = true } - return tab + return tab.MenuID !== newtab.MenuID }) - if (!isexit) { - tabs.splice(index + 1, 0, newtab) + if (tabviews.length !== tabs.length) { + this.props.modifyTabview(fromJS(tabs).toJS()) } + + this.setState({}, () => { + tabs.splice(index + 1, 0, newtab) + this.props.modifyTabview(tabs) + }) if (this.props.updateStatus) { this.props.updateStatus('trigger') } - - this.props.modifyTabview(tabs) } render() { -- Gitblit v1.8.0