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

Fix UI issues when migrating from rewards JSON to prefs #6057

Closed
wants to merge 1 commit into from

Conversation

zenparsing
Copy link
Collaborator

@zenparsing zenparsing commented Jul 9, 2020

Resolves brave/brave-browser#10717

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.

@@ -88,8 +88,11 @@ class SettingsPage extends React.Component<Props, State> {
componentDidUpdate (prevProps: Props, prevState: State) {
if (
this.props.rewardsData.enabledMain &&
prevProps.rewardsData.initializing &&
!this.props.rewardsData.initializing
(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change fixes an edge case where startRewards is not called if initializing is not transitioning from true to false.

@@ -76,7 +76,7 @@ interface BatLedger {
OnTimer(uint32 timer_id);

GetBalanceReport(ledger.mojom.ActivityMonth month, int32 year) =>
(ledger.mojom.Result result, ledger.mojom.BalanceReportInfo report);
(ledger.mojom.Result result, ledger.mojom.BalanceReportInfo? report);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change fixes a debug crash which occurs GetBalanceReport is called and an error condition is encountered.

@@ -298,7 +298,7 @@
"@types/storybook__react": "^4.0.2",
"acorn": "^7.1.1",
"babel-loader": "^8.1.0",
"brave-ui": "github:brave/brave-ui#303a9d6424950a31836902f9bf2c03a0c174efda",
"brave-ui": "github:brave/brave-ui#36f3cd135399060641123136feb8253e53d68499",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This version bump fixes an issue with the Select component.

@@ -45,6 +45,11 @@ void Balance::Fetch(ledger::FetchBalanceCallback callback) {
}

std::string payment_id = ledger_->GetPaymentId();
if (payment_id.empty()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This changes fixes an issue where the wallet endpoint can be requested with an empty payment ID path component.

@@ -68,7 +68,12 @@ export const rewardsPanelReducer: Reducer<RewardsExtension.State | undefined> =
})
} else if (result === RewardsExtension.Result.WALLET_CORRUPT) {
state.walletCorrupted = true
} else if (result !== RewardsExtension.Result.LEDGER_OK) {
} else if (result === RewardsExtension.Result.LEDGER_OK) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This change fixes an issue where the panel will display the welcome UI after a migration, even when rewards is enabled.

@zenparsing zenparsing marked this pull request as ready for review July 10, 2020 19:13
@zenparsing zenparsing marked this pull request as draft July 13, 2020 19:41
@zenparsing zenparsing closed this Aug 3, 2020
@zenparsing zenparsing deleted the ksmith-rewards-state-fixes branch September 11, 2020 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Desktop] monthly payment isn't always displayed on brave://rewards correctly - follow up to 10438
1 participant