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

Hides lion badge when count is 0 #7877

Merged
merged 1 commit into from
Mar 25, 2017
Merged

Conversation

NejcZdovc
Copy link
Contributor

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Resolves #7873

Auditors

@bsclifton @luixxiul

Test Plan

  • go to brave.com
  • badge should be hidden

Resolves brave#7873

Auditors: @bsclifton @luixxiul

Test Plan:
- go to brave.com
- badge should be hidden
@NejcZdovc NejcZdovc added this to the 0.14.0 milestone Mar 24, 2017
@NejcZdovc NejcZdovc self-assigned this Mar 24, 2017
@jonathansampson
Copy link
Collaborator

LGTM

Copy link
Member

@bsclifton bsclifton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback left- maybe when looking at the fingerprinting, we can do the tests 😄

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks great. I think it could be better though if you pulled the logic out to a method and then had a unit test for it, using enzyme 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants