@@ -17,7 +17,6 @@ function getConsent(): string | null { export function CookieConsent() { const { status } = useSession() - const account_type = useAppSelector((state) => state.user.account_type) const meStatus = useAppSelector((state) => state.user.status) const uid = useAppSelector((state) => state.user.uid) const [consent, setConsent] = React.useState(undefined) @@ -25,17 +24,13 @@ export function CookieConsent() { React.useEffect(() => { if (meStatus !== 'succeeded') return - if (account_type.startsWith('business')) { - stopYandexMetrika() - return - } const stored = getConsent() setConsent(stored) if (stored === 'all') { initYandexMetrika() if (uid) bindYandexMetrikaUserId(uid) } - }, [account_type, meStatus, uid]) + }, [meStatus, uid]) const choose = (value: string) => { localStorage.setItem('cookie-consent', value) @@ -47,15 +42,14 @@ export function CookieConsent() { } if (status !== 'authenticated' || meStatus !== 'succeeded') return null - if (account_type.startsWith('business') || consent !== null) return null + if (consent !== null) return null return (

Cookies и аналитика

- Мы используем технические cookies для работы сайта и аналитические cookies для улучшения - сервиса. Подробнее — в{' '} + Мы используем технические cookies для работы сайта и аналитические cookies для улучшения сервиса. Подробнее — в{' '} Политике обработки персональных данных @@ -16,13 +16,12 @@ export const DateInput = ({ date?: boolean prevdate?: boolean }) => { - useEffect(() => { if (date) { - setDate(new Date().toISOString().split('T')[0]) + setDate(dayjs().format('YYYY-MM-DD')) } if (prevdate) { - setDate(dayjs(new Date().toISOString()).add(-1, 'year').format('YYYY-DD-MM')) + setDate(dayjs().add(-1, 'year').format('YYYY-MM-DD')) } }, [date, prevdate]) @@ -42,16 +41,10 @@ export const DateInput = ({ width: '100%', }} label={label ? label : 'Дата'} - value={ - date - ? dayjs(new Date().toDateString()) - : prevdate - ? dayjs(new Date().toDateString()).add(-1, 'year') - : null - } + value={date ? dayjs() : prevdate ? dayjs().add(-1, 'year') : null} onChange={(date) => { if (date?.isValid()) { - setDate(JSON.stringify(date).split('"')[1].split('T')[0]) + setDate(date.format('YYYY-MM-DD')) } }} format='MM-DD-YYYY'