• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / fx-private-relay / 9d606149-97c1-4c70-a67d-6ab07818a5d2

29 May 2025 12:37AM UTC coverage: 85.574% (+0.2%) from 85.353%
9d606149-97c1-4c70-a67d-6ab07818a5d2

Pull #5573

circleci

vpremamozilla
for MPP-4155: add MEGABUNDLE_PROD_ID and MEGABUNDLE_PLANS to runtimeDatai
Pull Request #5573: MPP-4155 New Megabundle Banner Landing Page

2489 of 3629 branches covered (68.59%)

Branch coverage included in aggregate %.

60 of 62 new or added lines in 8 files covered. (96.77%)

20 existing lines in 7 files now uncovered.

17597 of 19843 relevant lines covered (88.68%)

9.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.95
/frontend/src/hooks/metrics.ts
1
import { useIsLoggedIn } from "./session";
8✔
2
import { useProfiles } from "./api/profile";
8✔
3
import { hasDoNotTrackEnabled } from "../functions/userAgent";
8✔
4

5
export type MetricsState = "enabled" | "disabled" | "unknown";
6

7
/**
8
 * Should metrics be emitted?
9
 * @returns MetricsState, 'unknown' if loading profile, 'enabled' or 'disabled' after loading
10
 */
11
export function useMetrics(): MetricsState {
144✔
12
  const isLoggedIn = useIsLoggedIn();
144✔
13
  const profileData = useProfiles();
144✔
14
  const dnt = hasDoNotTrackEnabled();
144✔
15
  if (dnt) {
144!
16
    return "disabled";
×
17
  }
18
  if (isLoggedIn === "unknown") {
144!
UNCOV
19
    return "unknown";
×
20
  }
21
  const anonVisitor = isLoggedIn === "logged-out";
144✔
22
  const profileMetricsEnabled = profileData?.data?.[0].metrics_enabled === true;
144✔
23
  const metricsEnabled = anonVisitor || profileMetricsEnabled;
144✔
24
  return metricsEnabled ? "enabled" : "disabled";
144✔
25
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc