diff --git a/frontend/src/components/StorageRow.tsx b/frontend/src/components/StorageRow.tsx index 10d248b..ab7dba1 100644 --- a/frontend/src/components/StorageRow.tsx +++ b/frontend/src/components/StorageRow.tsx @@ -1,7 +1,6 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { deleteStorage, updateStorage } from "../utils/api/storages"; import { useForm } from "@tanstack/react-form"; -import { useStore } from "@tanstack/react-store"; import { Button, IconButton, Input } from "@mui/joy"; import { Trash2 } from "lucide-react"; import type { Storage } from "../misc/interfaces"; @@ -56,11 +55,6 @@ export const StorageRow = ({ storage, onError }: StorageRowProps) => { }, }); - const values = useStore(form.baseStore, (state) => state.values); - const isDirty = - values.name !== storage.name || - (values.description ?? "") !== (storage.description ?? ""); - return ( <> {
- {isDirty && ( - - )} + + state.values.name !== storage.name || + (state.values.description ?? "") !== (storage.description ?? "") + } + > + {(isDirty) => + isDirty && ( + + ) + } +