mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 14:00:05 +02:00

[web] Allow editor redesign to be loaded through feature flag GitOrigin-RevId: b600b0d42c7a052fde19be3eee46c9e11cc3bac1
13 lines
522 B
TypeScript
13 lines
522 B
TypeScript
import { useUserSettingsContext } from '@/shared/context/user-settings-context'
|
|
import { isInExperiment } from '@/utils/labs-utils'
|
|
import { isSplitTestEnabled } from '@/utils/splitTestUtils'
|
|
|
|
export const canUseNewEditor = () =>
|
|
isInExperiment('editor-redesign') || isSplitTestEnabled('editor-redesign')
|
|
|
|
export const useIsNewEditorEnabled = () => {
|
|
const { userSettings } = useUserSettingsContext()
|
|
const hasAccess = canUseNewEditor()
|
|
const enabled = userSettings.enableNewEditor
|
|
return hasAccess && enabled
|
|
}
|