From 35c94be391094e62ba02d3093929785d37a07752 Mon Sep 17 00:00:00 2001 From: Emerick Rogul Date: Tue, 29 Jan 2019 15:45:00 -0500 Subject: [PATCH] Merge pull request #1493 from brave/fix-referral-headers-download Always fetch referral headers on startup --- .../brave_referrals/browser/brave_referrals_service.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/brave_referrals/browser/brave_referrals_service.cc b/components/brave_referrals/browser/brave_referrals_service.cc index f4de21cb57c2..b3dabc396e8f 100644 --- a/components/brave_referrals/browser/brave_referrals_service.cc +++ b/components/brave_referrals/browser/brave_referrals_service.cc @@ -91,7 +91,10 @@ void BraveReferralsService::Start() { base::Bind(&BraveReferralsService::GetFirstRunTime, base::Unretained(this))); - // Periodically fetch referral headers. + // Fetch the referral headers on startup. + FetchReferralHeaders(); + + // Also, periodically fetch the referral headers. DCHECK(!fetch_referral_headers_timer_); fetch_referral_headers_timer_ = std::make_unique(); fetch_referral_headers_timer_->Start( @@ -113,8 +116,6 @@ void BraveReferralsService::Start() { base::Unretained(this)), base::Bind(&BraveReferralsService::OnReadPromoCodeComplete, weak_factory_.GetWeakPtr())); - else - FetchReferralHeaders(); initialized_ = true; }