-
Notifications
You must be signed in to change notification settings - Fork 877
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
Auto-Contribute list only contains included publishers #475
Conversation
419c3ef
to
3440658
Compare
a671772
to
98b64bd
Compare
dd27728
to
7fcaf22
Compare
browser/ui/webui/brave_rewards_ui.cc
Outdated
@@ -293,6 +294,13 @@ void RewardsDOMHandler::GetWalletPassphrase(const base::ListValue* args) { | |||
} | |||
} | |||
|
|||
void RewardsDOMHandler::GetNumExcludedSites() { | |||
if (rewards_service_ && web_ui()->CanCallJavascript()) { | |||
int num = (int)rewards_service_->GetNumExcludedSites(); |
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.
Note: This is casted to int
because base::Value
doesn't support unsigned int
types for some reason
@@ -422,6 +422,8 @@ std::string PublisherInfoDatabase::BuildClauses(int start, | |||
if (filter.year > 0) | |||
clauses += " AND ai.year = ?"; | |||
|
|||
clauses += " AND pi.excluded = ?"; |
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 it possible that excluded is not provided in the filter?
@@ -452,6 +454,8 @@ void PublisherInfoDatabase::BindFilter(sql::Statement& statement, | |||
|
|||
if (filter.year > 0) | |||
statement.BindInt(column++, filter.year); | |||
|
|||
statement.BindInt(column++, filter.excluded); |
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.
see comment above
browser/ui/webui/brave_rewards_ui.cc
Outdated
@@ -442,6 +450,8 @@ void RewardsDOMHandler::OnGetContentSiteList(std::unique_ptr<brave_rewards::Cont | |||
publishers->Append(std::move(publisher)); | |||
} | |||
|
|||
// numExcludedSites should update with the new content list | |||
GetNumExcludedSites(); |
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.
Why do we need to get new number list when we are fetching regular list?
Shouldn't we just get it when you do exclude/include action?
db0d4df
to
ffd1001
Compare
@NejcZdovc this is ready for another look along with: brave-intl/bat-native-ledger#117 We should now be listening to the |
549d3a7
to
c175d3d
Compare
Auto-Contribute list only contains included pubs by default numExcludedSites is now part of the AppState and passed as a modalContribute prop
Auto-Contribute list only contains included publishers
Auto-Contribute list only contains included publishers
Fixes: brave/brave-browser#1175
This requires brave-intl/bat-native-ledger#117 for testing
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Essentially this can be best described as a regression test for the exclusion/restoration of excluded publishers.
Reviewer Checklist: