Skip to content

Commit

Permalink
We need to normalize synopsis after settings change
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Jan 18, 2019
1 parent 8b91da9 commit 5eeef84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions browser/ui/webui/brave_rewards_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -621,22 +621,18 @@ void RewardsDOMHandler::SaveSetting(const base::ListValue* args) {

if (key == "contributionMinTime") {
rewards_service_->SetPublisherMinVisitTime(std::stoull(value));
OnContentSiteUpdated(rewards_service_);
}

if (key == "contributionMinVisits") {
rewards_service_->SetPublisherMinVisits(std::stoul(value));
OnContentSiteUpdated(rewards_service_);
}

if (key == "contributionNonVerified") {
rewards_service_->SetPublisherAllowNonVerified(value == "true");
OnContentSiteUpdated(rewards_service_);
}

if (key == "contributionVideos") {
rewards_service_->SetPublisherAllowVideos(value == "true");
OnContentSiteUpdated(rewards_service_);
}

if (key == "enabledContribute") {
Expand Down
5 changes: 4 additions & 1 deletion vendor/bat-native-ledger/src/bat_publishers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,13 @@ void BatPublishers::OnRestorePublishersInternal(bool success) {
void BatPublishers::setPublisherMinVisitTime(const uint64_t& duration) { // In seconds
state_->min_publisher_duration_ = duration;
saveState();
synopsisNormalizer();
}

void BatPublishers::setPublisherMinVisits(const unsigned int& visits) {
state_->min_visits_ = visits;
saveState();
synopsisNormalizer();
}

void BatPublishers::setPublishersLastRefreshTimestamp(uint64_t ts) {
Expand All @@ -448,11 +450,13 @@ void BatPublishers::setNumExcludedSites(const unsigned int& amount) {
void BatPublishers::setPublisherAllowNonVerified(const bool& allow) {
state_->allow_non_verified_ = allow;
saveState();
synopsisNormalizer();
}

void BatPublishers::setPublisherAllowVideos(const bool& allow) {
state_->allow_videos_ = allow;
saveState();
synopsisNormalizer();
}

uint64_t BatPublishers::getPublisherMinVisitTime() const {
Expand Down Expand Up @@ -484,7 +488,6 @@ void BatPublishers::NormalizeContributeWinners(
bool saveData,
const ledger::PublisherInfoList& list,
uint32_t record) {

synopsisNormalizerInternal(newList, saveData, list, record);
}

Expand Down

0 comments on commit 5eeef84

Please sign in to comment.