From 5eeef849c9f1a4ac6dbb6aa9f0a145f54dfc5aaa Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Fri, 18 Jan 2019 18:54:41 +0100 Subject: [PATCH] We need to normalize synopsis after settings change Resolves https://github.com/brave/brave-browser/issues/3015 --- browser/ui/webui/brave_rewards_ui.cc | 4 ---- vendor/bat-native-ledger/src/bat_publishers.cc | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/browser/ui/webui/brave_rewards_ui.cc b/browser/ui/webui/brave_rewards_ui.cc index 65dd60781735..a0cf6601c185 100644 --- a/browser/ui/webui/brave_rewards_ui.cc +++ b/browser/ui/webui/brave_rewards_ui.cc @@ -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") { diff --git a/vendor/bat-native-ledger/src/bat_publishers.cc b/vendor/bat-native-ledger/src/bat_publishers.cc index 99cb8ad02ef7..90711a8b6166 100644 --- a/vendor/bat-native-ledger/src/bat_publishers.cc +++ b/vendor/bat-native-ledger/src/bat_publishers.cc @@ -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) { @@ -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 { @@ -484,7 +488,6 @@ void BatPublishers::NormalizeContributeWinners( bool saveData, const ledger::PublisherInfoList& list, uint32_t record) { - synopsisNormalizerInternal(newList, saveData, list, record); }