mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[web] Tear down editor-redesign-opt-out GitOrigin-RevId: c826691f3fdd4ad31403abae8adb353bd8c34897
22 lines
604 B
TypeScript
22 lines
604 B
TypeScript
import { useUserSettingsContext } from '@/shared/context/user-settings-context'
|
|
|
|
// For e2e tests purposes, allow overriding to old editor
|
|
export const oldEditorOverride =
|
|
new URLSearchParams(window.location.search).get('old-editor-override') ===
|
|
'true'
|
|
|
|
export const canUseNewEditor = () => {
|
|
return !oldEditorOverride
|
|
}
|
|
|
|
export const useIsNewEditorEnabled = () => {
|
|
return canUseNewEditor()
|
|
}
|
|
|
|
export const useIsNewToNewEditor = () => {
|
|
const { userSettings } = useUserSettingsContext()
|
|
const newEditor = useIsNewEditorEnabled()
|
|
|
|
return newEditor && !userSettings.enableNewEditorLegacy
|
|
}
|