Skip to content

Commit 0e9ca6f

Browse files
committed
fix(metrics): Use OAuthNativeServices for 'isFirefoxService' check
Because: * service=vpn was not being passed up in metrics context since it was missing from the isFirefoxService list This commit: * Removes the list and checks against OAuthNativeServices instead which is our source of truth for Fx services closes FXA-13325
1 parent 28c9850 commit 0e9ca6f

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

  • packages/fxa-settings/src/models/integrations

packages/fxa-settings/src/models/integrations/utils.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
import { OAuthNativeServices } from '@fxa/accounts/oauth';
66

7+
const oauthNativeServices = new Set<string>(Object.values(OAuthNativeServices));
8+
79
export function isFirefoxService(service?: string) {
8-
return (
9-
service === OAuthNativeServices.Sync ||
10-
service === OAuthNativeServices.Relay ||
11-
service === OAuthNativeServices.SmartWindow
12-
);
10+
return !!service && oauthNativeServices.has(service);
1311
}
1412

1513
const NO_LONGER_SUPPORTED_CONTEXTS = new Set([

0 commit comments

Comments
 (0)