-
Notifications
You must be signed in to change notification settings - Fork 975
Removes non-primitive types from TabPage #9794
Conversation
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.
Comments left- otherwise looks good 😄
}] | ||
|
||
const tabPageMenu = Menu.buildFromTemplate(template) | ||
tabPageMenu.popup(getCurrentWindow()) |
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.
Would be great to have a unit test that ensures when windowConstants.WINDOW_ON_TAB_PAGE_MENU
happens that electron.remote.Menu.buildFromTemplate
fires and that popup
is called on the instance that it returns 😄
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.
done
|
||
const frames = frameStateUtil.getNonPinnedFrames(state) || Immutable.List() | ||
const tabsPerPage = Number(getSetting(settings.TABS_PER_PAGE)) | ||
const tabPageFrames = frames.slice(action.get('index') * tabsPerPage, (action.get('index') * tabsPerPage) + tabsPerPage) |
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.
Would be good to read action.get('index')
into a variable and skip processing if:
- index is null /undefined
- index is out of bounds (negative value, over the max number of tab pages)
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.
done
ce69e5f
to
28baeee
Compare
@bsclifton can we merged this one? |
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.
++
@@ -69,6 +70,15 @@ class TabPage extends React.Component { | |||
e.preventDefault() | |||
} | |||
|
|||
onContextMenu (e) { | |||
e.stopPropagation() | |||
windowActions.onTabPageMenu(this.props.index) |
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.
just a nit, but I think windowActions. onTabPageContextMenu
would be better here
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.
done
Resolves brave#9793 Auditors: @bsclifton @bridiver Test Plan:
28baeee
to
a117b9f
Compare
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.
++ great job w/ tests 😄
Submitter Checklist:
git rebase -i
to squash commits (if needed).Resolves #9793
Auditors: @bsclifton @bridiver
Test Plan:
Reviewer Checklist:
Tests