From 4c4ddbc971b6a7c300ce0304ea04cdcae8392563 Mon Sep 17 00:00:00 2001 From: NejcZdovc Date: Mon, 14 Jan 2019 20:54:16 +0100 Subject: [PATCH] Fixes publisher not showing in the panel if ac off Resolves https://github.com/brave/brave-browser/issues/2084 --- vendor/bat-native-ledger/src/bat_publishers.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/vendor/bat-native-ledger/src/bat_publishers.cc b/vendor/bat-native-ledger/src/bat_publishers.cc index c7d60c62f15a..64c4ae479ff4 100644 --- a/vendor/bat-native-ledger/src/bat_publishers.cc +++ b/vendor/bat-native-ledger/src/bat_publishers.cc @@ -75,10 +75,6 @@ void BatPublishers::AddRecurringPayment(const std::string& publisher_id, const d saveState(); } -bool BatPublishers::saveVisitAllowed() const { - return (ledger_->GetRewardsMainEnabled() && ledger_->GetAutoContribute()); -} - void onVisitSavedDummy(ledger::Result result, std::unique_ptr publisher_info) { // onPublisherInfoUpdated will always be called by LedgerImpl so do nothing @@ -87,7 +83,7 @@ void onVisitSavedDummy(ledger::Result result, void BatPublishers::saveVisit(const std::string& publisher_id, const ledger::VisitData& visit_data, const uint64_t& duration) { - if (!saveVisitAllowed() || publisher_id.empty()) { + if (!ledger_->GetRewardsMainEnabled() || publisher_id.empty()) { return; } @@ -217,8 +213,10 @@ void BatPublishers::saveVisitInternal( // set duration to 0 if you don't have sufficient visit time // or if you set ac to only verified and site is not verified + // or if auto contribute if off if ((!ignoreMinTime(publisher_id) && duration < getPublisherMinVisitTime()) || - (!ledger_->GetPublisherAllowNonVerified() && !verified)) { + (!ledger_->GetPublisherAllowNonVerified() && !verified) || + !ledger_->GetAutoContribute()) { duration = 0; }