Add feature flag detection for profile redesign (#37472)

This commit is contained in:
Echo
2026-01-13 14:17:43 +00:00
committed by GitHub
parent 232b9e9cc6
commit 122b1592ed
+15 -2
View File
@@ -12,8 +12,21 @@ export function isProduction() {
else return import.meta.env.PROD;
}
export type Features = 'fasp' | 'http_message_signatures';
export type ServerFeatures = 'fasp';
export function isFeatureEnabled(feature: Features) {
export function isServerFeatureEnabled(feature: ServerFeatures) {
return initialState?.features.includes(feature) ?? false;
}
type ClientFeatures = 'profile_redesign';
export function isClientFeatureEnabled(feature: ClientFeatures) {
try {
const features =
window.localStorage.getItem('experiments')?.split(',') ?? [];
return features.includes(feature);
} catch (err) {
console.warn('Could not access localStorage to get client features', err);
return false;
}
}