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

mozilla / fx-private-relay / d4d9f278-d845-4992-8c81-4f3757c427a1

08 Sep 2025 02:07PM UTC coverage: 86.303% (-1.8%) from 88.121%
d4d9f278-d845-4992-8c81-4f3757c427a1

Pull #5842

circleci

joeherm
fix(deploy): Update CircleCI to use common Dockerfile for building frontend
Pull Request #5842: fix(deploy): Unify Dockerfiles

2744 of 3951 branches covered (69.45%)

Branch coverage included in aggregate %.

17910 of 19981 relevant lines covered (89.64%)

9.96 hits per line

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

82.61
/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 {
140✔
12
  const isLoggedIn = useIsLoggedIn();
140✔
13
  const profileData = useProfiles();
140✔
14
  const dnt = hasDoNotTrackEnabled();
140✔
15
  if (dnt) {
140!
16
    return "disabled";
×
17
  }
18
  if (isLoggedIn === "unknown") {
140!
19
    return "unknown";
×
20
  }
21
  const anonVisitor = isLoggedIn === "logged-out";
140✔
22
  const profileMetricsEnabled = profileData?.data?.[0].metrics_enabled === true;
140✔
23
  const metricsEnabled = anonVisitor || profileMetricsEnabled;
140✔
24
  return metricsEnabled ? "enabled" : "disabled";
140✔
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