-
Notifications
You must be signed in to change notification settings - Fork 971
"Select its parent tab" setting now works as expected #9400
Conversation
Requires brave/muon#214 before this can be merged |
- Don't consider if tab was active or not - Validate tabId before returning requires brave/muon#214 Fixes #9395 Auditors: @bridiver, @BrendanEich
ping @bridiver |
app/common/state/tabState.js
Outdated
const openerTabId = tabState.getTabPropertyByTabId(state, tabId, 'openerTabId', tabState.TAB_ID_NONE) | ||
if (openerTabId !== tabState.TAB_ID_NONE) { | ||
// Validate that tabId exists | ||
const index = getTabInternalIndexByTabId(state, openerTabId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably use getByTabId
here and it already handles TAB_ID_NONE by returning null. getTabInternalIndex
is just a temporary hack until we can re-organize the tab state so best to limit its usage to the smallest set of methods possible
app/browser/reducers/tabsReducer.js
Outdated
@@ -51,15 +51,14 @@ const updateActiveTab = (state, closeTabId) => { | |||
case tabCloseAction.PARENT: | |||
{ | |||
const openerTabId = tabState.getOpenerTabId(state, closeTabId) | |||
const lastActiveTabId = tabState.getLastActiveTabId(state, windowId) | |||
if (openerTabId === lastActiveTabId) { | |||
if (openerTabId && openerTabId !== tabState.TAB_ID_NONE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the null
check here necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ a few nits, but lgtm
nits fixed 😄 merging |
"Select its parent tab" setting now works as expected
"Select its parent tab" setting now works as expected
"Select its parent tab" setting now works as expected
Fixes #9395
Auditors: @bridiver, @BrendanEich
Submitter Checklist:
git rebase -i
to squash commits (if needed).Reviewer Checklist:
Tests