Skip to content

Commit 6762502

Browse files
authored
Fix browse posture checks table filters (#448)
1 parent 042c65a commit 6762502

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/modules/posture-checks/table/PostureCheckBrowseTable.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import { Checkbox } from "@components/Checkbox";
33
import { DataTable } from "@components/table/DataTable";
44
import DataTableHeader from "@components/table/DataTableHeader";
55
import DataTableRefreshButton from "@components/table/DataTableRefreshButton";
6-
import { useLocalStorage } from "@hooks/useLocalStorage";
76
import {
87
ColumnDef,
98
RowSelectionState,
109
SortingState,
1110
} from "@tanstack/react-table";
1211
import useFetchApi from "@utils/api";
13-
import { usePathname } from "next/navigation";
1412
import React, { useState } from "react";
1513
import { useSWRConfig } from "swr";
1614
import { PostureCheck } from "@/interfaces/PostureCheck";
@@ -25,18 +23,14 @@ export default function PostureCheckBrowseTable({ onAdd }: Readonly<Props>) {
2523
const { data: postureChecks, isLoading } =
2624
useFetchApi<PostureCheck[]>("/posture-checks");
2725
const { mutate } = useSWRConfig();
28-
const path = usePathname();
2926

3027
// Default sorting state of the table
31-
const [sorting, setSorting] = useLocalStorage<SortingState>(
32-
"netbird-table-sort" + path,
33-
[
34-
{
35-
id: "name",
36-
desc: true,
37-
},
38-
],
39-
);
28+
const [sorting, setSorting] = useState<SortingState>([
29+
{
30+
id: "name",
31+
desc: true,
32+
},
33+
]);
4034

4135
const [selectedRows, setSelectedRows] = useState<RowSelectionState>({});
4236

@@ -47,6 +41,7 @@ export default function PostureCheckBrowseTable({ onAdd }: Readonly<Props>) {
4741
rowSelection={selectedRows}
4842
setRowSelection={setSelectedRows}
4943
isLoading={isLoading}
44+
keepStateInLocalStorage={false}
5045
text={"Posture Check"}
5146
sorting={sorting}
5247
wrapperClassName={""}

0 commit comments

Comments
 (0)