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

Commit

Permalink
Merge pull request #7877 from NejcZdovc/hotfix/#7873-lion
Browse files Browse the repository at this point in the history
Hides lion badge when count is 0
  • Loading branch information
bsclifton authored Mar 25, 2017
2 parents 396cdbc + e703150 commit 577f9b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ class Main extends ImmutableComponent {
const trackers = frames.getIn(['trackingProtection', 'blocked'])
const blocked = (ads ? ads.size : 0) + (trackers ? trackers.size : 0)

return (blocked > 99) ? '99+' : blocked
return (blocked.size === 0) ? false : ((blocked > 99) ? '99+' : blocked)
}

render () {
Expand Down Expand Up @@ -945,6 +945,7 @@ class Main extends ImmutableComponent {

const appStateSites = this.props.appState.get('sites')
const activeTabShowingMessageBox = !!(activeTab && activeTab.get('messageBoxDetail'))
const totalBlocks = this.getTotalBlocks(activeFrame)

return <div id='window'
className={cx({
Expand Down Expand Up @@ -1077,9 +1078,9 @@ class Main extends ImmutableComponent {
: null
}
{
!this.braveShieldsDisabled
!this.braveShieldsDisabled && totalBlocks
? <div className={css(styles.lionBadge)} data-test-id='lionBadge'>
{this.getTotalBlocks(activeFrame)}
{totalBlocks}
</div>
: null
}
Expand Down Expand Up @@ -1370,7 +1371,8 @@ const styles = StyleSheet.create({
font: '7pt "Arial Narrow"',
textAlign: 'center',
border: '.5px solid #FFF',
background: '#555555'
background: '#555555',
minWidth: '9px'
}
})

Expand Down

0 comments on commit 577f9b6

Please sign in to comment.