Skip to content

Commit

Permalink
Fixes tipping when allow videos if off
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Jan 22, 2019
1 parent abf6094 commit 2f22f21
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vendor/bat-native-ledger/src/ledger_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,12 @@ void LedgerImpl::SaveMediaVisit(const std::string& publisher_id,
const ledger::VisitData& visit_data,
const uint64_t& duration,
const uint64_t window_id) {
if (bat_publishers_->getPublisherAllowVideos()) {
bat_publishers_->saveVisit(publisher_id, visit_data, duration, window_id);
uint64_t new_duration = duration;
if (!bat_publishers_->getPublisherAllowVideos()) {
new_duration = 0;
}

bat_publishers_->saveVisit(publisher_id, visit_data, new_duration, window_id);
}

void LedgerImpl::SetPublisherExclude(const std::string& publisher_id, const ledger::PUBLISHER_EXCLUDE& exclude) {
Expand Down

0 comments on commit 2f22f21

Please sign in to comment.