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

Commit

Permalink
Never create pinned tab duplicates
Browse files Browse the repository at this point in the history
This could happen on slow machine startups when there were multiple state changes before pinned tabs were added

Fix #1508

Auditors: @diracdeltas
  • Loading branch information
bbondy committed May 29, 2016
1 parent 7514ecf commit 170f4cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
- Added show only favicon option to the bookmarks toolbar. ([#1657](https://github.com/brave/browser-laptop/issues/1657))
- Added bookmark tooltips. ([#1848](https://github.com/brave/browser-laptop/issues/1848))
- Added folder icons when using bookmark toolbar favicons. ([#1469](https://github.com/brave/browser-laptop/issues/1469))
- Added application icon in Ubuntu ([#1282](https://github.com/brave/browser-laptop/issues/1282))
- Added application icon in Ubuntu. ([#1282](https://github.com/brave/browser-laptop/issues/1282))
- Expose chrome.runtime for better site compat mainly for Google drive. ([#1948](https://github.com/brave/browser-laptop/pull/1948))
- Fixed processes sometimes not quitting. ([#1756](https://github.com/brave/browser-laptop/issues/1756))
- Fixed Windows taskbar grouping. ([#156](https://github.com/brave/browser-laptop/issues/156))
- Fixed whitescreen which could happen when dragging and dropping ([#1891](https://github.com/brave/browser-laptop/issues/1891))
- Fixed bookmark items middle click to open in a new tab on Windows 10 ([#1724](https://github.com/brave/browser-laptop/issues/1724))
- Fixed whitescreen which could happen when dragging and dropping. ([#1891](https://github.com/brave/browser-laptop/issues/1891))
- Fixed bookmark items middle click to open in a new tab on Windows 10. ([#1724](https://github.com/brave/browser-laptop/issues/1724))
- Fixed redownloading files on session restore ([#1219](https://github.com/brave/browser-laptop/issues/1219))
- Upgrade to HTTPS Everywhere definitions for 5.1.9 ([#1692](https://github.com/brave/browser-laptop/issues/1692))
- Fixed pinned tabs sometimes duplicating. ([#1508](https://github.com/brave/browser-laptop/issues/1508))
- Upgrade to HTTPS Everywhere definitions for 5.1.9. ([#1692](https://github.com/brave/browser-laptop/issues/1692))
- Upgrade to libchromiumcontent 51.0.2704.63. ([#1405](https://github.com/brave/browser-laptop/issues/1405))
- Upgrade to Electron 1.2.0. ([#1968])([#1968](https://github.com/brave/browser-laptop/issues/1968))
- Upgrade to Node 6.1. ([#1969])([#1969](https://github.com/brave/browser-laptop/issues/1969))
Expand Down
13 changes: 12 additions & 1 deletion js/state/frameStateUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,23 @@ function addFrame (frames, frameOpts, newKey, partitionNumber, activeFrameKey) {
const navbarFocus = activeFrameKey === newKey &&
url === config.defaultUrl &&
frameOpts.delayedLoadUrl === undefined
const location = frameOpts.delayedLoadUrl || url // page url

// Only add pin requests if it's not already added
if (frameOpts.isPinned) {
const alreadyPinnedFrameProps = frames.find((frame) =>
frame.get('pinnedLocation') === location && frame.get('partitionNumber') === partitionNumber)
if (alreadyPinnedFrameProps) {
return {}
}
}

const frame = Immutable.fromJS({
zoomLevel: config.zoom.defaultValue,
audioMuted: false, // frame is muted
canGoBack: false,
canGoForward: false,
location: frameOpts.delayedLoadUrl || url, // page url
location,
aboutDetails: undefined,
src: url, // what the iframe src should be
tabId: -1,
Expand Down

0 comments on commit 170f4cb

Please sign in to comment.