Skip to content

Commit 0ba2f93

Browse files
edwardgou-sentrytrillville
authored andcommitted
feat(webvitals): use flag in stored scores setting (#63254)
Add `starfish-browser-webvitals-use-backend-scores` check in useStoredScoresSetting
1 parent 6dcc1cc commit 0ba2f93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
import {decodeScalar} from 'sentry/utils/queryString';
22
import {useLocation} from 'sentry/utils/useLocation';
3+
import useOrganization from 'sentry/utils/useOrganization';
34
import {USE_STORED_SCORES} from 'sentry/views/performance/browser/webVitals/settings';
45

56
export function useStoredScoresSetting() {
67
const location = useLocation();
78
const {query} = location;
9+
const organization = useOrganization();
810

911
if (query.useStoredScores !== undefined) {
1012
return decodeScalar(query.useStoredScores) === 'true';
1113
}
1214

15+
if (organization.features.includes('starfish-browser-webvitals-use-backend-scores')) {
16+
return true;
17+
}
18+
1319
return USE_STORED_SCORES;
1420
}

0 commit comments

Comments
 (0)