Client: Created general useSavedState function

This commit is contained in:
Donkie
2023-07-15 14:38:40 +02:00
parent a54e28d353
commit 3cab6166a3
2 changed files with 12 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ import { ISpool } from "./model";
import {
TableState,
useInitialTableState,
useShowArchive,
useSavedState,
useStoreInitialState,
} from "../../utils/saveload";
import {
@@ -55,7 +55,10 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
const initialState = useInitialTableState("spoolList");
// State for the switch to show archived spools
const [showArchived, setShowArchived] = useShowArchive("spoolList");
const [showArchived, setShowArchived] = useSavedState(
"spoolList-showArchived",
false
);
// Fetch data from the API
const {