Files
klz-cables.com/.pnpm-store/v10/files/87/aac1f16f6276f6118e7673e3ada27269d2780a95dc7b033573be1b0f5e714fad5b9fc0959ab38193dcba3ccde40159fb397a8a7f3db1119ec07481cd983e5f
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

51 lines
1.1 KiB
Plaintext

'use client';
import { c as _c } from "react/compiler-runtime";
import { useModal } from '@faceless-ui/modal';
import { usePathname } from 'next/navigation.js';
import { useEffect, useRef } from 'react';
import { useEffectEvent } from '../../hooks/useEffectEvent.js';
export function CloseModalOnRouteChange() {
const $ = _c(6);
const {
closeAllModals
} = useModal();
const pathname = usePathname();
let t0;
if ($[0] !== closeAllModals) {
t0 = () => {
closeAllModals();
};
$[0] = closeAllModals;
$[1] = t0;
} else {
t0 = $[1];
}
const closeAllModalsEffectEvent = useEffectEvent(t0);
const initialRenderRef = useRef(true);
let t1;
if ($[2] !== closeAllModalsEffectEvent) {
t1 = () => {
if (initialRenderRef.current) {
initialRenderRef.current = false;
return;
}
closeAllModalsEffectEvent();
};
$[2] = closeAllModalsEffectEvent;
$[3] = t1;
} else {
t1 = $[3];
}
let t2;
if ($[4] !== pathname) {
t2 = [pathname];
$[4] = pathname;
$[5] = t2;
} else {
t2 = $[5];
}
useEffect(t1, t2);
return null;
}
//# sourceMappingURL=index.js.map