mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-03-22 03:08:23 +00:00
fix(ui): reapply filter transition opacity overlay on filter changes (#10036)
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
||||
|
||||
import { useFilterTransitionOptional } from "@/contexts";
|
||||
|
||||
const FINDINGS_PATH = "/findings";
|
||||
const DEFAULT_MUTED_FILTER = "false";
|
||||
|
||||
@@ -16,6 +18,7 @@ export const useUrlFilters = () => {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const pathname = usePathname();
|
||||
const filterTransition = useFilterTransitionOptional();
|
||||
const isPending = false;
|
||||
|
||||
const ensureFindingsDefaultMuted = (params: URLSearchParams) => {
|
||||
@@ -29,7 +32,10 @@ export const useUrlFilters = () => {
|
||||
ensureFindingsDefaultMuted(params);
|
||||
|
||||
const queryString = params.toString();
|
||||
if (queryString === searchParams.toString()) return;
|
||||
|
||||
const targetUrl = queryString ? `${pathname}?${queryString}` : pathname;
|
||||
filterTransition?.signalFilterChange();
|
||||
router.push(targetUrl, { scroll: false });
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user