diff --git a/app/helpers/inertia/setup.ts b/app/helpers/inertia/setup.ts index 75935176..49d192e3 100644 --- a/app/helpers/inertia/setup.ts +++ b/app/helpers/inertia/setup.ts @@ -1,4 +1,5 @@ import { router } from "@inertiajs/core"; +import { closeAllModals } from "@mantine/modals"; export const setupInertia = (): void => { router.on("before", ({ detail: { visit } }) => { @@ -7,4 +8,7 @@ export const setupInertia = (): void => { visit.headers["X-CSRF-Token"] = csrfToken; } }); + router.on("navigate", () => { + closeAllModals(); + }); };