Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Commit

Permalink
Rename to
Browse files Browse the repository at this point in the history
  • Loading branch information
piatra committed Jul 8, 2019
1 parent b795b25 commit b5253f1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions content-src/asrouter/docs/targeting-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Please note that some targeting attributes require stricter controls on the tele
* [xpinstallEnabled](#xpinstallEnabled)
* [hasPinnedTabs](#haspinnedtabs)
* [hasAccessedFxAPanel](#hasaccessedfxapanel)
* [hasWhatsNewPanelEnabled](#haswhatsnewpanelenabled)
* [isWhatsNewPanelEnabled](#iswhatsnewpanelenabled)

## Detailed usage

Expand Down Expand Up @@ -487,12 +487,12 @@ Boolean pref that gets set the first time the user opens the FxA toolbar panel
declare const hasAccessedFxAPanel: boolean;
```

### `hasWhatsNewPanelEnabled`
### `isWhatsNewPanelEnabled`

Boolean pref that controls if the What's New panel feature is enabled

#### Definition

```ts
declare const hasWhatsNewPanelEnabled: boolean;
declare const isWhatsNewPanelEnabled: boolean;
```
2 changes: 1 addition & 1 deletion lib/ASRouterTargeting.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ const TargetingGetters = {
true
);
},
get hasWhatsNewPanelEnabled() {
get isWhatsNewPanelEnabled() {
return Services.prefs.getBoolPref(
"browser.messaging-system.whatsNewPanel.enabled",
false
Expand Down
2 changes: 1 addition & 1 deletion lib/OnboardingMessageProvider.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const ONBOARDING_MESSAGES = async () => [
lifetime: Infinity,
},
// Never saw this message or saw it in the past 4 days or more recent
targeting: `hasWhatsNewPanelEnabled &&
targeting: `isWhatsNewPanelEnabled &&
(firefoxVersion > previousSessionFirefoxVersion &&
messageImpressions[.id == 'WHATS_NEW_BADGE_${FIREFOX_VERSION}']|length == 0) ||
(messageImpressions[.id == 'WHATS_NEW_BADGE_${FIREFOX_VERSION}']|length >= 1 &&
Expand Down
6 changes: 3 additions & 3 deletions test/browser/browser_asrouter_targeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,17 +823,17 @@ add_task(async function check_hasAccessedFxAPanel() {
);
});

add_task(async function check_hasWhatsNewPanelEnabled() {
add_task(async function check_isWhatsNewPanelEnabled() {
is(
await ASRouterTargeting.Environment.hasWhatsNewPanelEnabled,
await ASRouterTargeting.Environment.isWhatsNewPanelEnabled,
false,
"Not enabled yet"
);

await pushPrefs(["browser.messaging-system.whatsNewPanel.enabled", true]);

is(
await ASRouterTargeting.Environment.hasWhatsNewPanelEnabled,
await ASRouterTargeting.Environment.isWhatsNewPanelEnabled,
true,
"Should update based on pref"
);
Expand Down

0 comments on commit b5253f1

Please sign in to comment.