mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #36408 from overleaf/mj-context-menu-flag-teardown
[web] Tear down editor-context-menu flag GitOrigin-RevId: 80cc2ebaf62ec1bd6064b0f96b884d159a9d4b5f
This commit is contained in:
committed by
Copybot
parent
38eb3ddfa6
commit
e8ee19d17d
@@ -60,7 +60,6 @@ import { beforeChangeDocEffect } from '@/features/source-editor/extensions/befor
|
||||
import { useActiveOverallTheme } from '@/shared/hooks/use-active-overall-theme'
|
||||
import { useEditorSelectionContext } from '@/shared/context/editor-selection-context'
|
||||
import { useActiveEditorTheme } from '@/shared/hooks/use-active-editor-theme'
|
||||
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
||||
import { isCmVisualEditorAvailable } from '../utils/visual-editor'
|
||||
import { setEditorTabs } from '../extensions/tabs-listener'
|
||||
import { setReviewTooltip } from '../extensions/review-tooltip'
|
||||
@@ -100,7 +99,6 @@ function useCodeMirrorScope(view: EditorView) {
|
||||
const { onlineUserCursorHighlights } = useOnlineUsersContext()
|
||||
|
||||
const { project, features: projectFeatures } = useProjectContext()
|
||||
const editorContextMenuEnabled = useFeatureFlag('editor-context-menu')
|
||||
let spellCheckLanguage = project?.spellCheckLanguage || ''
|
||||
// spell check is off when read-only
|
||||
if (!permissions.write && !permissions.trackedWrite) {
|
||||
@@ -227,7 +225,6 @@ function useCodeMirrorScope(view: EditorView) {
|
||||
}, [view, spellCheckLanguage, hunspellManager])
|
||||
|
||||
const projectFeaturesRef = useRef(projectFeatures)
|
||||
const editorContextMenuEnabledRef = useRef(editorContextMenuEnabled)
|
||||
|
||||
// listen to doc:after-opened, and focus the editor if it's not a new doc
|
||||
useEffect(() => {
|
||||
@@ -355,7 +352,6 @@ function useCodeMirrorScope(view: EditorView) {
|
||||
spelling: spellingRef.current,
|
||||
visual: visualRef.current,
|
||||
projectFeatures: projectFeaturesRef.current,
|
||||
editorContextMenuEnabled: editorContextMenuEnabledRef.current,
|
||||
initialSearchQuery: searchQueryRef.current,
|
||||
showBoundary,
|
||||
handleException,
|
||||
@@ -495,9 +491,7 @@ function useCodeMirrorScope(view: EditorView) {
|
||||
useEffect(() => {
|
||||
settingsRef.current.floatingMenu = floatingMenu
|
||||
window.setTimeout(() => {
|
||||
view.dispatch(
|
||||
setReviewTooltip(floatingMenu, editorContextMenuEnabledRef.current)
|
||||
)
|
||||
view.dispatch(setReviewTooltip(floatingMenu))
|
||||
})
|
||||
}, [view, floatingMenu])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user