-
Notifications
You must be signed in to change notification settings - Fork 900
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
Enables Ads on rewards opt-in via panel and welcome page #1282
Conversation
components/brave_rewards/resources/ui/reducers/rewards_reducer.ts
Outdated
Show resolved
Hide resolved
let's wait with merging this one as their is some discussion to not have this one in |
Blocker removed as we are moving forward with this one |
components/brave_rewards/resources/ui/reducers/wallet_reducer.ts
Outdated
Show resolved
Hide resolved
...brave_rewards/resources/extension/brave_rewards/background/reducers/rewards_panel_reducer.ts
Outdated
Show resolved
Hide resolved
@@ -41,6 +41,7 @@ export const rewardsPanelReducer = (state: RewardsExtension.State | undefined, a | |||
case types.ON_WALLET_CREATED: | |||
state = { ...state } | |||
state.walletCreated = true | |||
chrome.braveRewards.saveAdsSetting('adsEnabled', 'true') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this necessary? what if someone wants to create a new wallet (ex: after deleting their original one) but don't want to opt into ads?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very good point, I'll have to dig around and see if we have something existing that can differentiate between a first time opt-in and what is technically a recreation, as in both cases they are handled more or less the same from the creation side
@@ -17,6 +17,7 @@ const createWallet = (state: Rewards.State) => { | |||
|
|||
chrome.send('brave_rewards.getReconcileStamp') | |||
chrome.send('brave_rewards.getAddresses') | |||
chrome.send('brave_rewards.saveAdsSetting', ['adsEnabled', 'true']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same concern as https://github.com/brave/brave-core/pull/1282/files#r246943290. i feel it is likely we will want to allow wallet creation independent of changing adsEnabled to true.
@diracdeltas per our conversation over slack, I've renamed/reorganized some of the involved redux actions to be a bit more semantic, hopefully clearer about what is happening when an opt-in occurs |
9c8ff2c
to
c38c880
Compare
per further discussion with @diracdeltas, we can move forward with this pr as is. We should have a discussion on how we can decouple the wallet creation action from opt-in, as there will be cases in the future where a user can re-create a wallet (after deleting one), but they are not necessarily re-opting in to Rewards as a whole. Wallet creation should be an independent action. cc: @NejcZdovc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from discussion above, lgtm
Fixes: brave/brave-browser#2877
Submitter Checklist:
npm test brave_unit_tests && npm test brave_browser_tests
) ongit rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
brave://rewards
, create wallet via the welcome pagebrave://rewards
and repeat step 3Reviewer Checklist: