Skip to content
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

Fixes publisher not showing in the panel if ac off #1336

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions vendor/bat-native-ledger/src/bat_publishers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<ledger::PublisherInfo> publisher_info) {
// onPublisherInfoUpdated will always be called by LedgerImpl so do nothing
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down