Skip to content

Commit

Permalink
Return early when onboarding notifications aren't finished (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
k88hudson authored and glogiotatidis committed Oct 19, 2017
1 parent a788463 commit 706a944
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions snippets/base/templates/base/includes/snippet_as.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,19 @@ var ABOUTHOME_SHOWN_SNIPPET = null;
var USER_COUNTRY = null;
var GEO_CACHE_DURATION = 1000 * 60 * 60 * 24 * 30; // 30 days


(function() {
(async function() {
'use strict';

// See https://github.com/mozilla/activity-stream/blob/master/docs/v2-system-addon/snippets.md
// for documentation on the gSnippetsMap API

// If onboardingFinished is false, there may already be an onboarding snippet
// shown so we cannot show a snippet. However, .disableOnboarding() can be
// called so that it won't be shown on the *next* new tab
if (gSnippetsMap.get("appData.onboardingFinished") === false) {
return;
}

// Fetch user country if we don't have it.
if (!haveUserCountry()) {
downloadUserCountry();
Expand Down

0 comments on commit 706a944

Please sign in to comment.