From f016822fcd23aef820d3daea75853dbf3948607b Mon Sep 17 00:00:00 2001 From: bridiver Date: Sat, 17 Jun 2017 19:47:47 -0700 Subject: [PATCH] check to see if the tab was active before it was closed fix #9306 --- app/browser/reducers/tabsReducer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/browser/reducers/tabsReducer.js b/app/browser/reducers/tabsReducer.js index 4c4828ecf3c..00ce8b726a9 100644 --- a/app/browser/reducers/tabsReducer.js +++ b/app/browser/reducers/tabsReducer.js @@ -37,12 +37,13 @@ const updateActiveTab = (state, closeTabId) => { return } - if (!tabState.isActive(state, closeTabId)) { + const windowId = tabState.getWindowId(state, closeTabId) + if (windowId === windowState.WINDOW_ID_NONE) { return } - const windowId = tabState.getWindowId(state, closeTabId) - if (windowId === windowState.WINDOW_ID_NONE) { + const lastActiveTabId = tabState.getTabsByLastActivated(state, windowId).last() + if (lastActiveTabId !== closeTabId && !tabState.isActive(state, closeTabId)) { return }