Skip to content

Commit d29fcab

Browse files
authored
Merge pull request #1413 from brave/allow-videos
Fixes tipping when allow videos if off
2 parents c4be192 + 2f22f21 commit d29fcab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vendor/bat-native-ledger/src/ledger_impl.cc

+5-2
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,12 @@ void LedgerImpl::SaveMediaVisit(const std::string& publisher_id,
333333
const ledger::VisitData& visit_data,
334334
const uint64_t& duration,
335335
const uint64_t window_id) {
336-
if (bat_publishers_->getPublisherAllowVideos()) {
337-
bat_publishers_->saveVisit(publisher_id, visit_data, duration, window_id);
336+
uint64_t new_duration = duration;
337+
if (!bat_publishers_->getPublisherAllowVideos()) {
338+
new_duration = 0;
338339
}
340+
341+
bat_publishers_->saveVisit(publisher_id, visit_data, new_duration, window_id);
339342
}
340343

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

0 commit comments

Comments
 (0)