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

Commit

Permalink
Prevent a situation whereby a session-store can somehow end up with n…
Browse files Browse the repository at this point in the history
…o perWindowState[].closedFrames property, which would then cause the app never recover, even after restart.

Fix #13261, although since that's not reproducible I'm not sure the moving-tab keyboard shortcut neccessarily caused it, but something did, and this will allow recovery in that situation.
  • Loading branch information
petemill committed Feb 23, 2018
1 parent 12aa8bb commit 60d7a65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions js/stores/appStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ const handleAppAction = (action) => {
break
}
case appConstants.APP_SHOW_NOTIFICATION:
let notifications = appState.get('notifications')
let notifications = appState.get('notifications', Immutable.List())
notifications = notifications.filterNot((notification) => {
let message = notification.get('message')
// action.detail is a regular mutable object only when running tests
Expand Down Expand Up @@ -340,7 +340,7 @@ const handleAppAction = (action) => {
appState = appState.set('notifications', notifications)
break
case appConstants.APP_HIDE_NOTIFICATION:
appState = appState.set('notifications', appState.get('notifications').filterNot((notification) => {
appState = appState.set('notifications', appState.get('notifications', Immutable.List()).filterNot((notification) => {
return notification.get('message') === action.message
}))
break
Expand All @@ -355,7 +355,7 @@ const handleAppAction = (action) => {
const tabsInOrigin = tabState.getTabs(appState).find((tabValue) =>
urlUtil.getOrigin(tabValue.get('url')) === origin && tabValue.get('tabId') !== immutableAction.get('tabId'))
if (!tabsInOrigin) {
appState = appState.set('notifications', appState.get('notifications').filterNot((notification) => {
appState = appState.set('notifications', appState.get('notifications', Immutable.List()).filterNot((notification) => {
return notification.get('frameOrigin') === origin
}))
}
Expand Down
2 changes: 1 addition & 1 deletion js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ const doAction = (action) => {
windowState = windowState.set('closedFrames', new Immutable.List())
} else {
windowState = windowState.set('closedFrames',
windowState.get('closedFrames').filterNot((frame) => frame.get('location') === action.location))
windowState.get('closedFrames', Immutable.List()).filterNot((frame) => frame.get('location') === action.location))
}
break
case windowConstants.WINDOW_SET_PREVIEW_TAB_PAGE_INDEX:
Expand Down

0 comments on commit 60d7a65

Please sign in to comment.