Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewards button pre-opt-in badge dismisses after first button press #3898

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

petemill
Copy link
Member

@petemill petemill commented Nov 6, 2019

We use a new pref to store the "badge text" value. Whilst we could store a boolean value whose state would be "has dismissed notification" (or not), this method is more future proof for having multiple variations of badge text, especially if or when this button becomes 'native' all the time (i.e. not an extension icon where the badge is controlled via JS).

Fix brave/brave-browser#6691

Test plan

  1. Clean user data directory
  2. Launch Brave
  3. Create a second profile via App Menu -> Create a New Profile
  4. Expected: Both profile windows have the rewards icon with the badge text "1"
  5. Click the rewards button in the second profile window
  6. Expected: The second profile window's rewards icon does not have a badge
  7. Expected: The first profile window's rewards icon does have a badge
  8. Quit the browser
  9. Start the browser again
  10. Expected: The rewards icon badge state from each profile window is the same as 5) and 6)

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

We use a new pref to store the "badge text" value. Whilst we could store a boolean value whose state would be "has dismissed notification" (or not), this method is more future proof for having multiple variations of badge text, especially if or when this button becomes 'native' all the time (i.e. not an extension icon where the badge is controlled via JS)
@petemill petemill self-assigned this Nov 6, 2019
@bsclifton bsclifton added this to the 0.74.x - Nightly milestone Nov 6, 2019
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.

Works beautifully! 😄👌

@bsclifton
Copy link
Member

Restarted CI (there were some issues; thanks @linhkikuchi and @mihaiplesa for the help!). This next run should be accurate 👍

@bsclifton bsclifton merged commit e991ab8 into master Nov 7, 2019
@bsclifton bsclifton deleted the rewards-stub-dismiss-badge branch November 7, 2019 16:53
brave-builds pushed a commit that referenced this pull request Nov 7, 2019
brave-builds pushed a commit that referenced this pull request Nov 7, 2019
petemill pushed a commit that referenced this pull request Nov 7, 2019
Rewards button pre-opt-in badge dismisses after first button press
bsclifton added a commit that referenced this pull request Nov 8, 2019
0.71.x: Uplift #3898 (Rewards button pre-opt-in badge dismisses after first button press)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to dismiss the first rewards notification
3 participants