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

Commit

Permalink
don't show the welcome tab in the buffer window
Browse files Browse the repository at this point in the history
Fix #13238
  • Loading branch information
petemill committed Feb 21, 2018
1 parent 1b8741c commit cdd8cfc
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions app/browser/reducers/tabsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,23 +360,28 @@ const tabsReducer = (state, action, immutableAction) => {
}
break
case appConstants.APP_WINDOW_READY: {
// Get the window's id from the action or the sender
if (!action.getIn(['createProperties', 'windowId'])) {
const senderWindowId = action.getIn(['senderWindowId'])
if (senderWindowId) {
action = action.setIn(['createProperties', 'windowId'], senderWindowId)
}
}

const welcomeScreenProperties = {
'url': 'about:welcome',
'windowId': action.getIn(['createProperties', 'windowId'])
}

const shouldShowWelcomeScreen = state.getIn(['about', 'welcome', 'showOnLoad'])
if (shouldShowWelcomeScreen) {
setImmediate(() => tabs.create(welcomeScreenProperties))
// We only need to run welcome screen once
state = state.setIn(['about', 'welcome', 'showOnLoad'], false)
// Show welcome tab in first window on first start,
// but not in the buffer window.
const windowId = action.getIn(['createProperties', 'windowId'])
const bufferWindow = windows.getBufferWindow()
if (!bufferWindow || bufferWindow.id !== windowId) {
const welcomeScreenProperties = {
url: 'about:welcome',
windowId
}
const shouldShowWelcomeScreen = state.getIn(['about', 'welcome', 'showOnLoad'])
if (shouldShowWelcomeScreen) {
setImmediate(() => tabs.create(welcomeScreenProperties))
// We only need to run welcome screen once
state = state.setIn(['about', 'welcome', 'showOnLoad'], false)
}
}
break
}
Expand Down

0 comments on commit cdd8cfc

Please sign in to comment.