Force modern emoji experimental to be dev mode only (#35505)

This commit is contained in:
Echo 2025-07-24 16:55:00 +02:00 committed by GitHub
commit dfaca794bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 19 deletions

View file

@ -1,3 +1,5 @@
import initialState from '../initial_state';
export function isDevelopment() {
if (typeof process !== 'undefined')
return process.env.NODE_ENV === 'development';
@ -9,3 +11,13 @@ export function isProduction() {
return process.env.NODE_ENV === 'production';
else return import.meta.env.PROD;
}
export type Features = 'modern_emojis';
export function isFeatureEnabled(feature: Features) {
return initialState?.features.includes(feature) ?? false;
}
export function isModernEmojiEnabled() {
return isFeatureEnabled('modern_emojis') && isDevelopment();
}