|
|
@@ -1,31 +1,28 @@
|
|
|
import { useTutorial } from '@/shared/hooks/promotions/use-tutorial'
|
|
|
-
|
|
|
import { useEditorContext } from '@/shared/context/editor-context'
|
|
|
-import { useProjectSettingsContext } from '../editor-left-menu/context/project-settings-context'
|
|
|
-
|
|
|
+import { useProjectContext } from '@/shared/context/project-context'
|
|
|
import OLNotification from '@/shared/components/ol/ol-notification'
|
|
|
-import getMeta from '@/utils/meta'
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
import { useCallback } from 'react'
|
|
|
+import { onRollingBuild } from '@/shared/utils/rolling-build'
|
|
|
|
|
|
export const TUTORIAL_KEY = 'rolling-compile-image-changed'
|
|
|
-const rollingImages = getMeta('ol-imageNames')
|
|
|
- .filter(img => img.rolling)
|
|
|
- .map(img => img.imageName)
|
|
|
|
|
|
const RollingCompileImageChangedAlert = () => {
|
|
|
const { completeTutorial } = useTutorial(TUTORIAL_KEY)
|
|
|
-
|
|
|
+ const { project } = useProjectContext()
|
|
|
const { inactiveTutorials } = useEditorContext()
|
|
|
- const { imageName } = useProjectSettingsContext()
|
|
|
+
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
const onClose = useCallback(() => {
|
|
|
completeTutorial({ event: 'promo-click', action: 'complete' })
|
|
|
}, [completeTutorial])
|
|
|
|
|
|
- const onRollingBuild = imageName && rollingImages.includes(imageName)
|
|
|
- if (inactiveTutorials.includes(TUTORIAL_KEY) || !onRollingBuild) {
|
|
|
+ if (
|
|
|
+ inactiveTutorials.includes(TUTORIAL_KEY) ||
|
|
|
+ !onRollingBuild(project?.imageName)
|
|
|
+ ) {
|
|
|
return null
|
|
|
}
|
|
|
|