Skip to content

Commit

Permalink
Don't initialize referral system for non-referral builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bsclifton committed Mar 2, 2021
1 parent ebd72de commit b299160
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/brave_referrals/browser/brave_referrals_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,16 @@ void BraveReferralsService::OnReferralFinalizationCheckLoadComplete(
}

void BraveReferralsService::OnReadPromoCodeComplete() {
if (!promo_code_.empty()) {
if (!promo_code_.empty() && !IsDefaultReferralCode(promo_code_)) {
pref_service_->SetString(kReferralPromoCode, promo_code_);
DCHECK(!initialization_timer_);
InitReferral();
} else {
// No referral code, no point of reporting it.
// store referral code if it's not empty (ex: it's the default code)
if (!promo_code_.empty()) {
pref_service_->SetString(kReferralPromoCode, promo_code_);
}
// No referral code or it's the default, no point of reporting it.
pref_service_->SetBoolean(kReferralInitialization, true);
if (!referral_initialized_callback_.is_null())
referral_initialized_callback_.Run(std::string());
Expand Down

0 comments on commit b299160

Please sign in to comment.