| 1 | import { useEffect } from "react"; |
| 2 | import { useDispatch } from "react-redux"; |
| 3 | import { useAppSelector } from "../../redux/hooks"; |
| 4 | import { setDialogMessage, setShowDialog } from "../../redux/slices/uiSlice"; |
| 5 | import { PlatformOnboardingCard } from "../OnboardingCard/platform/PlatformOnboardingCard"; |
| 6 | |
| 7 | function FreeTrialOverDialog() { |
| 8 | const dispatch = useDispatch(); |
| 9 | const history = useAppSelector((store) => store.session.history); |
| 10 | |
| 11 | useEffect(() => { |
| 12 | if (history.length === 0) { |
| 13 | dispatch(setShowDialog(false)); |
| 14 | dispatch(setDialogMessage(undefined)); |
| 15 | } |
| 16 | }, [history]); |
| 17 | |
| 18 | return ( |
| 19 | <div className="flex-1"> |
| 20 | <PlatformOnboardingCard isDialog /> |
| 21 | </div> |
| 22 | ); |
| 23 | } |
| 24 | |
| 25 | export default FreeTrialOverDialog; |