From a92d7d58536a030f83c2f2752fc1081a3b264da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EF=BD=81=EF=BD=99=EF=BD=95=EF=BD=8D=EF=BD=89=C2=A0=20?= =?UTF-8?q?=EF=BD=99=EF=BD=95?= Date: Tue, 9 May 2017 19:12:01 +0000 Subject: [PATCH] In nav bar bookmarked star, check only the specific siteKey Rather than iterating over all sites. Test Plan: 1. Make sure automated tests pass --- .../components/navigation/navigationBar.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/renderer/components/navigation/navigationBar.js b/app/renderer/components/navigation/navigationBar.js index 6076095822..15f0a66a66 100644 --- a/app/renderer/components/navigation/navigationBar.js +++ b/app/renderer/components/navigation/navigationBar.js @@ -100,11 +100,16 @@ class NavigationBar extends React.Component { } get bookmarked () { - return this.props.activeFrameKey !== undefined && - siteUtil.isSiteBookmarked(this.props.sites, Immutable.fromJS({ - location: this.props.location, - partitionNumber: this.props.partitionNumber - })) + if (typeof this.props.activeFrameKey === 'undefined') { + return false + } + const siteDetail = Immutable.fromJS({ + location: this.props.location, + partitionNumber: this.props.partitionNumber + }) + const siteKey = siteUtil.getSiteKey(siteDetail) + const site = this.props.sites.getIn([siteKey]) + return siteUtil.isBookmark(site) } componentDidMount () {