|
|
@@ -14,7 +14,6 @@ import Close from '@/shared/components/close'
|
|
|
import { Trans, useTranslation } from 'react-i18next'
|
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
import useTutorial from '@/shared/hooks/promotions/use-tutorial'
|
|
|
-import { useFeatureFlag } from '@/shared/context/split-test-context'
|
|
|
|
|
|
function AllHistoryList() {
|
|
|
const { id: currentUserId } = useUserContext()
|
|
|
@@ -102,18 +101,6 @@ function AllHistoryList() {
|
|
|
name: 'react-history-buttons-tutorial',
|
|
|
})
|
|
|
|
|
|
- const {
|
|
|
- showPopup: showRestorePromo,
|
|
|
- tryShowingPopup: tryShowingRestorePromo,
|
|
|
- hideUntilReload: hideRestorePromoUntilReload,
|
|
|
- completeTutorial: completeRestorePromo,
|
|
|
- } = useTutorial('history-restore-promo', {
|
|
|
- name: 'history-restore-promo',
|
|
|
- })
|
|
|
- const inFileRestoreSplitTest = useFeatureFlag('revert-file')
|
|
|
- const inProjectRestoreSplitTest = useFeatureFlag('revert-project')
|
|
|
-
|
|
|
- const hasVisibleUpdates = visibleUpdates.length > 0
|
|
|
const isMoreThanOneVersion = visibleUpdates.length > 1
|
|
|
const [layoutSettled, setLayoutSettled] = useState(false)
|
|
|
|
|
|
@@ -127,9 +114,6 @@ function AllHistoryList() {
|
|
|
const hasCompletedHistoryTutorial = inactiveTutorials.includes(
|
|
|
'react-history-buttons-tutorial'
|
|
|
)
|
|
|
- const hasCompletedRestorePromotion = inactiveTutorials.includes(
|
|
|
- 'history-restore-promo'
|
|
|
- )
|
|
|
|
|
|
// wait for the layout to settle before showing popover, to avoid a flash/ instant move
|
|
|
if (!layoutSettled) {
|
|
|
@@ -141,19 +125,8 @@ function AllHistoryList() {
|
|
|
!isPaywallAndNonComparable
|
|
|
) {
|
|
|
tryShowingHistoryTutorial()
|
|
|
- } else if (
|
|
|
- !hasCompletedRestorePromotion &&
|
|
|
- inFileRestoreSplitTest &&
|
|
|
- inProjectRestoreSplitTest &&
|
|
|
- hasVisibleUpdates
|
|
|
- ) {
|
|
|
- tryShowingRestorePromo()
|
|
|
}
|
|
|
}, [
|
|
|
- hasVisibleUpdates,
|
|
|
- inFileRestoreSplitTest,
|
|
|
- inProjectRestoreSplitTest,
|
|
|
- tryShowingRestorePromo,
|
|
|
inactiveTutorials,
|
|
|
isMoreThanOneVersion,
|
|
|
isPaywallAndNonComparable,
|
|
|
@@ -169,7 +142,6 @@ function AllHistoryList() {
|
|
|
// meaning the tutorial will show on page reload/ re-navigation
|
|
|
const hidePopover = () => {
|
|
|
hideHistoryTutorialUntilReload()
|
|
|
- hideRestorePromoUntilReload()
|
|
|
}
|
|
|
|
|
|
if (showHistoryTutorial) {
|
|
|
@@ -224,47 +196,6 @@ function AllHistoryList() {
|
|
|
</OLPopover>
|
|
|
</OLOverlay>
|
|
|
)
|
|
|
- } else if (showRestorePromo) {
|
|
|
- popover = (
|
|
|
- <OLOverlay
|
|
|
- placement="left-start"
|
|
|
- show={showRestorePromo}
|
|
|
- rootClose
|
|
|
- onHide={hidePopover}
|
|
|
- // using scrollerRef to position the popover in the middle of the viewport
|
|
|
- target={scrollerRef.current}
|
|
|
- >
|
|
|
- <OLPopover
|
|
|
- id="popover-history-restore-promo"
|
|
|
- title={
|
|
|
- <span>
|
|
|
- {t('history_restore_promo_title')}
|
|
|
- <Close
|
|
|
- variant="dark"
|
|
|
- onDismiss={() =>
|
|
|
- completeRestorePromo({
|
|
|
- event: 'promo-click',
|
|
|
- action: 'complete',
|
|
|
- })
|
|
|
- }
|
|
|
- />
|
|
|
- </span>
|
|
|
- }
|
|
|
- className="dark-themed history-popover"
|
|
|
- >
|
|
|
- <Trans
|
|
|
- i18nKey="history_restore_promo_content"
|
|
|
- components={[
|
|
|
- // eslint-disable-next-line react/jsx-key
|
|
|
- <MaterialIcon
|
|
|
- type="more_vert"
|
|
|
- className="history-restore-promo-icon"
|
|
|
- />,
|
|
|
- ]}
|
|
|
- />
|
|
|
- </OLPopover>
|
|
|
- </OLOverlay>
|
|
|
- )
|
|
|
}
|
|
|
|
|
|
// give the components time to position before showing popover so we don't get an instant position change
|