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

Commit

Permalink
Hides lion badge when count is 0
Browse files Browse the repository at this point in the history
Resolves #7873

Auditors: @bsclifton @luixxiul

Test Plan:
- go to brave.com
- badge should be hidden
  • Loading branch information
NejcZdovc authored and bsclifton committed Mar 25, 2017
1 parent e7a55b8 commit 29acdac
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 29acdac

Please sign in to comment.