diff --git a/lib/utils/hooks/metrics/useVkMetricsGoals.ts b/lib/utils/hooks/metrics/useVkMetricsGoals.ts index d7c6437..53c34fa 100644 --- a/lib/utils/hooks/metrics/useVkMetricsGoals.ts +++ b/lib/utils/hooks/metrics/useVkMetricsGoals.ts @@ -1,5 +1,3 @@ -import { useEffect, useState } from "react"; - import type { MetricsMessengers } from "@model/metrics"; type MetricsGoal = { @@ -20,15 +18,7 @@ const sendMetrics = (vkPixelId: number | undefined, goal: string) => { } }; -export const useVkMetricsGoals = (vkPixelId: number | undefined) => { - const [vkId, setVkId] = useState(undefined); - - useEffect(() => { - if (vkPixelId) { - setVkId(vkPixelId); - } - }, [vkPixelId]); - +export const useVkMetricsGoals = (vkId: number | undefined) => { return { // Посетитель открыл квиз quizOpened: () => sendMetrics(vkId, "penaquiz-start"), diff --git a/lib/utils/hooks/metrics/useYandexMetricsGoals.ts b/lib/utils/hooks/metrics/useYandexMetricsGoals.ts index fb4ccaf..6ec5a35 100644 --- a/lib/utils/hooks/metrics/useYandexMetricsGoals.ts +++ b/lib/utils/hooks/metrics/useYandexMetricsGoals.ts @@ -1,5 +1,3 @@ -import { useEffect, useState } from "react"; - import type { MetricsMessengers } from "@model/metrics"; type ExtendedWindow = Window & { @@ -12,15 +10,7 @@ const sendMetrics = (yandexMetricsId: number | undefined, goal: string) => { } }; -export const useYandexMetricsGoals = (yandexMetricsId: number | undefined) => { - const [id, setId] = useState(undefined); - - useEffect(() => { - if (yandexMetricsId) { - setId(yandexMetricsId); - } - }, [yandexMetricsId]); - +export const useYandexMetricsGoals = (id: number | undefined) => { return { // Посетитель открыл квиз quizOpened: () => sendMetrics(id, "penaquiz-start"),