diff --git a/client/src/pages/me/ui/sections/NotificationsPage.tsx b/client/src/pages/me/ui/sections/NotificationsPage.tsx index f1b07be..a9c5819 100644 --- a/client/src/pages/me/ui/sections/NotificationsPage.tsx +++ b/client/src/pages/me/ui/sections/NotificationsPage.tsx @@ -6,11 +6,14 @@ import Stack from '@mui/material/Stack' import Switch from '@mui/material/Switch' import Typography from '@mui/material/Typography' import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' +import { useUnit } from 'effector-react' import { fetchUserNotificationSettings, updateUserNotificationSettings, } from '@/entities/notification/api/notifications-api' import type { UserNotificationSettings } from '@/entities/notification/api/notifications-api' +import { isSyntheticEmail } from '@/shared/lib/is-synthetic-email' +import { $user } from '@/shared/model/auth' function isOrderStatusChangesOn(s: UserNotificationSettings): boolean { return s.orderCreated && s.orderStatusChanged && s.paymentStatusChanged && s.deliveryFeeAdjusted @@ -26,6 +29,7 @@ const orderStatusChangesPayload = (on: boolean) => ({ export function NotificationsPage() { const queryClient = useQueryClient() const [error, setError] = useState(null) + const user = useUnit($user) const { data, isLoading } = useQuery({ queryKey: ['me', 'notifications', 'settings'], @@ -63,6 +67,12 @@ export function NotificationsPage() { Настройте, какие уведомления вы хотите получать на почту. + {user && isSyntheticEmail(user.email) && ( + + Ваша почта сгенерирована автоматически. Для получения уведомлений укажите реальную почту в настройках профиля. + + )} + {error && ( {error}