Просмотр исходного кода

Merge pull request #28604 from overleaf/mj-limit-beta-modal

[web] Remove beta modal for new-user-split-test groups

GitOrigin-RevId: d61a3338472608620d199ef3ee7ef028e90f5aa0
David 1 год назад
Родитель
Сommit
3aa85df34a

+ 4 - 2
services/web/frontend/js/features/ide-redesign/components/switcher-modal/beta-modal.tsx

@@ -10,6 +10,7 @@ import { FC, useCallback, useEffect } from 'react'
 import {
   canUseNewEditor,
   useIsNewEditorEnabled,
+  useIsNewEditorEnabledViaPrimaryFeatureFlag,
 } from '../../utils/new-editor-utils'
 import Notification from '@/shared/components/notification'
 import { useSwitchEnableNewEditorState } from '../../hooks/use-switch-enable-new-editor-state'
@@ -30,14 +31,15 @@ export const IdeRedesignIntroModal: FC = () => {
       name: TUTORIAL_KEY,
     }
   )
+  const hasAccess = useIsNewEditorEnabledViaPrimaryFeatureFlag()
 
   useEffect(() => {
+    if (!hasAccess) return
     if (!inactiveTutorials.includes(TUTORIAL_KEY)) {
       tryShowingPopup()
     }
-  }, [tryShowingPopup, inactiveTutorials])
+  }, [tryShowingPopup, inactiveTutorials, hasAccess])
 
-  const hasAccess = canUseNewEditor()
   if (!hasAccess) {
     return null
   }