From 6a7bd44063b7e20b1de024e88fe17a445bd3656b Mon Sep 17 00:00:00 2001 From: Abdel LAMRANI Date: Mon, 13 Jul 2026 12:27:56 +0200 Subject: [PATCH 1/3] fix: :bug: hook isMobile by changing to another --- resources/ts/front/Layouts/AppLayout.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/ts/front/Layouts/AppLayout.tsx b/resources/ts/front/Layouts/AppLayout.tsx index 3a8ba3f..3df502d 100644 --- a/resources/ts/front/Layouts/AppLayout.tsx +++ b/resources/ts/front/Layouts/AppLayout.tsx @@ -3,7 +3,7 @@ import { type ReactNode } from "react"; import BackToTop from "@/front/partials/BackToTop"; import Footer from "@/front/partials/Footer"; -import useIsMobile from "@/hooks/use-mobile"; +import useDeviceType from "@/hooks/use-device-type"; import { positionBannerButton } from "../Components/cookie/constants"; import CookieNotice from "../Components/cookie/CookieNotice"; @@ -15,13 +15,14 @@ interface AppLayoutProps { } export default function AppLayout({ children }: Readonly) { - const isMobile = useIsMobile(); + const { isMobile } = useDeviceType(); const { canonical } = usePage().props as { canonical?: string }; return (
Date: Mon, 13 Jul 2026 12:32:00 +0200 Subject: [PATCH 2/3] fix: :bug: hook isMobile by changing to another --- resources/ts/front/Layouts/AppLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ts/front/Layouts/AppLayout.tsx b/resources/ts/front/Layouts/AppLayout.tsx index 3df502d..9b71b20 100644 --- a/resources/ts/front/Layouts/AppLayout.tsx +++ b/resources/ts/front/Layouts/AppLayout.tsx @@ -22,7 +22,7 @@ export default function AppLayout({ children }: Readonly) {
Date: Mon, 13 Jul 2026 14:35:54 +0200 Subject: [PATCH 3/3] fix: :bug: fix cookie duplicating matomo script --- resources/ts/front/Components/Layout/Head.tsx | 7 ++++++- resources/ts/front/lib/cookie.ts | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/resources/ts/front/Components/Layout/Head.tsx b/resources/ts/front/Components/Layout/Head.tsx index 26f490b..7c0adba 100644 --- a/resources/ts/front/Components/Layout/Head.tsx +++ b/resources/ts/front/Components/Layout/Head.tsx @@ -28,7 +28,12 @@ export default function Head({ title, description }: HeadProps) { return ( {title} - {description && } + {description && ( + <> + + + + )} {title && } diff --git a/resources/ts/front/lib/cookie.ts b/resources/ts/front/lib/cookie.ts index cace10e..c27570b 100644 --- a/resources/ts/front/lib/cookie.ts +++ b/resources/ts/front/lib/cookie.ts @@ -293,6 +293,14 @@ export const createServiceHandlers = ( ); return; } + // If the script is already in the DOM, Matomo is already running — do not + // re-push into _paq (would trigger "setTrackerUrl/setSiteId registered more + // than once" warnings caused by applyDecidedStatuses being called multiple times). + // Added 13/07/2026 + if (document.getElementById("script-matomo")) { + notifyConsentChange("matomo", accepted); + return; + } const w = window; w._paq = w._paq ?? []; w._paq.push(["trackPageView"]);