diff --git a/src/common/ResponsiveTable.tsx b/src/common/ResponsiveTable.tsx index 204a5b8..df661ac 100644 --- a/src/common/ResponsiveTable.tsx +++ b/src/common/ResponsiveTable.tsx @@ -121,7 +121,18 @@ export default function ResponsiveTable(props: Props) { const [openGutters, setOpenGutters] = useState([]) const [handler, setHandler] = useState(undefined); const [columnAnchor, setColumnAnchor] = useState(null) - const [filterList, setFilterList] = useState([]) + + const filterKey = window.location.pathname.split('/').pop() + "-table-filter-list"; + + const [filterList, setFilterList] = useState(() => { + const saved = localStorage.getItem(filterKey); + return saved ? JSON.parse(saved) : []; + }); + + useEffect(() => { + console.log(filterList) + localStorage.setItem(filterKey, JSON.stringify(filterList)); + }, [filterList]) const openColumnMenu = (event: any) => { setColumnAnchor(event.currentTarget); diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 5390005..836024e 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -232,10 +232,6 @@ export default function Devices() { loadGroups() }, [groupLimit, groupPage, orderGroup, orderGroupBy, searchGroup]) - useEffect(() => { - console.log(search) - }, [search]) - const handleChange = (event: any) => { setLimit(event.target.value); };