Skip to content

Fixes storage not persist after reset #6285

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

Merged
merged 1 commit into from
Jul 31, 2020
Merged

Fixes storage not persist after reset #6285

merged 1 commit into from
Jul 31, 2020

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented Jul 31, 2020

Resolves brave/brave-browser#11024

Submitter Checklist:

Test Plan:

  • enable rewards
  • reset rewards
  • make sure that you see welcome page
  • refresh page
  • make sure that you still see welcome page

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.

@NejcZdovc NejcZdovc requested a review from bridiver as a code owner July 31, 2020 10:26
@NejcZdovc NejcZdovc self-assigned this Jul 31, 2020
@NejcZdovc NejcZdovc requested review from a team, emerick and zenparsing and removed request for bridiver and a team July 31, 2020 10:26
@NejcZdovc NejcZdovc added the CI/skip Do not run CI builds (except noplatform) label Jul 31, 2020
@NejcZdovc NejcZdovc added CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS and removed CI/skip Do not run CI builds (except noplatform) labels Jul 31, 2020
@NejcZdovc NejcZdovc added this to the 1.14.x - Nightly milestone Jul 31, 2020
@@ -24,8 +24,9 @@ const mergeReducers = (state: Rewards.State | undefined, action: any) => {

if (!state) {
state = storage.defaultState
storage.save(state)
} else if (state !== startingState) {
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is where the problem was as we used save directly and then debounced save came after that and override it. So now we use debounce for this one as well

Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

@NejcZdovc NejcZdovc merged commit 70b57ce into master Jul 31, 2020
@NejcZdovc NejcZdovc deleted the reset-reducer branch July 31, 2020 18:03
NejcZdovc pushed a commit that referenced this pull request Aug 3, 2020
NejcZdovc pushed a commit that referenced this pull request Aug 3, 2020
@LaurenWags
Copy link
Member

Verified using

Brave | 1.14.11 Chromium: 84.0.4147.105 (Official Build) nightly (64-bit)
-- | --
Revision | a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS | macOS Version 10.14.6 (Build 18G3020)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-android Do not run CI builds for Android CI/skip-ios Do not run CI builds for iOS feature/rewards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refreshing/restarting browser after resetting wallet shows Rewards settings page
4 participants