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

Commit

Permalink
Merge pull request #9189 from brave/no-force-active
Browse files Browse the repository at this point in the history
Don't force active tab for background tabs
  • Loading branch information
bsclifton authored Jun 1, 2017
2 parents b097dcb + 3d116b4 commit 37ad4e8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ const addToHistory = (frameProps) => {
return history.slice(-10)
}

const newFrame = (state, frameOpts, openInForeground, insertionIndex, nextKey) => {
const newFrame = (state, frameOpts, openInForeground) => {
if (frameOpts === undefined) {
frameOpts = {}
}
frameOpts = frameOpts.toJS ? frameOpts.toJS() : frameOpts

// handle tabs.create properties
insertionIndex = frameOpts.index !== undefined
let insertionIndex = frameOpts.index !== undefined
? frameOpts.index
: insertionIndex
: undefined

if (frameOpts.partition) {
frameOpts.isPrivate = frameStateUtil.isPrivatePartition(frameOpts.partition)
Expand All @@ -121,7 +121,8 @@ const newFrame = (state, frameOpts, openInForeground, insertionIndex, nextKey) =
openInForeground = frameOpts.disposition !== 'background-tab'
}

if (openInForeground === undefined) {
const activeFrame = frameStateUtil.getActiveFrame(state)
if (openInForeground === undefined || !activeFrame) {
openInForeground = true
}

Expand Down Expand Up @@ -172,10 +173,7 @@ const newFrame = (state, frameOpts, openInForeground, insertionIndex, nextKey) =
insertionIndex = 0
}

if (nextKey === undefined) {
nextKey = incrementNextKey()
openInForeground = true
}
const nextKey = incrementNextKey()

state = state.merge(
frameStateUtil.addFrame(
Expand Down

0 comments on commit 37ad4e8

Please sign in to comment.