Remeber piece query on pieces page
This commit is contained in:
@@ -8,6 +8,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
|
||||
import { useBreakpoint } from "@/hooks/useBreakpoint";
|
||||
import { useCache } from "@/hooks/useCache";
|
||||
import { useLoading } from "@/hooks/useLoading";
|
||||
import { setPieceQueryAuthor, setPieceQueryName, useStore } from "@/hooks/useStore";
|
||||
import { authors, created, DEBOUNCE, modified, SAVE_DELAY } from "@/snippets";
|
||||
import clsx from "clsx";
|
||||
import { PieceId, Updater } from "common";
|
||||
@@ -20,8 +21,8 @@ import { Link, useNavigate } from "react-router-dom";
|
||||
|
||||
export function Pieces() {
|
||||
|
||||
const [name, setName] = useState("");
|
||||
const [author, setAuthor] = useState("");
|
||||
const name = useStore(state => state.pieceQueryName);
|
||||
const author = useStore(state => state.pieceQueryAuthor);
|
||||
|
||||
const [importDialogOpen, setImportDialogOpen] = useState(false);
|
||||
|
||||
@@ -65,7 +66,7 @@ export function Pieces() {
|
||||
placeholder="Tytuł"
|
||||
value={name}
|
||||
onChange={(e) => {
|
||||
setName(e.target.value);
|
||||
setPieceQueryName(e.target.value);
|
||||
debounce.current = DEBOUNCE;
|
||||
}}
|
||||
/>
|
||||
@@ -75,7 +76,7 @@ export function Pieces() {
|
||||
placeholder="Twórcy"
|
||||
value={author}
|
||||
onChange={(e) => {
|
||||
setAuthor(e.target.value);
|
||||
setPieceQueryAuthor(e.target.value);
|
||||
debounce.current = DEBOUNCE;
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user