useReplaceFidWithInpSetting.tsx 672 B

1234567891011121314151617181920
  1. import {decodeScalar} from 'sentry/utils/queryString';
  2. import {useLocation} from 'sentry/utils/useLocation';
  3. import useOrganization from 'sentry/utils/useOrganization';
  4. import {REPLACE_FID_WITH_INP} from 'sentry/views/performance/browser/webVitals/settings';
  5. export function useReplaceFidWithInpSetting() {
  6. const location = useLocation();
  7. const {query} = location;
  8. const organization = useOrganization();
  9. if (query.replaceFidWithInp !== undefined) {
  10. return decodeScalar(query.replaceFidWithInp) === 'true';
  11. }
  12. if (organization.features.includes('starfish-browser-webvitals-replace-fid-with-inp')) {
  13. return true;
  14. }
  15. return REPLACE_FID_WITH_INP;
  16. }