Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
pick last active from the right end of the set
Browse files Browse the repository at this point in the history
only update last active when active
  • Loading branch information
bridiver committed May 25, 2017
1 parent 15ac56a commit 85d0fb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/common/state/tabState.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ const matchTab = function (queryInfo, tab) {
}

const updateLastActive = (state, oldTabValue, newTabValue) => {
if (!newTabValue.get('active')) {
return state
}

const oldTabId = validateId('tabId', oldTabValue.get('tabId'))
const oldWindowId = validateId('windowId', oldTabValue.get('windowId'))

Expand Down Expand Up @@ -367,7 +371,7 @@ const tabState = {
},

getLastActiveTabId: (state, windowId) => {
const tabId = tabState.getTabsByLastActivated(state, windowId).slice(1, 2).first()
const tabId = tabState.getTabsByLastActivated(state, windowId).slice(-2).first()
if (tabId == null) {
return tabState.TAB_ID_NONE
}
Expand Down

0 comments on commit 85d0fb5

Please sign in to comment.