fix: cleanup

This commit is contained in:
2026-06-04 06:42:27 -05:00
parent f989b144cf
commit 654cfec147
52 changed files with 290 additions and 540 deletions
-4
View File
@@ -57,7 +57,6 @@ export function LibraryPage() {
const [filters, setFilters] = useState<FilterState>({ genre: "", author: "", reading_status: "" });
const [genres, setGenres] = useState<string[]>([]);
const [authors, setAuthors] = useState<string[]>([]);
const [totalCount, setTotalCount] = useState(0);
const [showFilters, setShowFilters] = useState(false);
const [showSuggestions, setShowSuggestions] = useState(false);
const [contextMenu, setContextMenu] = useState<ContextMenuState | null>(null);
@@ -95,11 +94,9 @@ export function LibraryPage() {
items = items.filter((b) => b.reading_status === params.reading_status);
}
setBooks(items);
setTotalCount(items.length);
} catch (err) {
setError(err instanceof Error ? err.message : t("library.loadFailed"));
setBooks([]);
setTotalCount(0);
} finally {
setLoading(false);
}
@@ -169,7 +166,6 @@ export function LibraryPage() {
refreshFilterOptions(next);
return next;
});
setTotalCount((count) => Math.max(0, count - 1));
}, [refreshFilterOptions]);
const handleBookContextMenu = useCallback((e: React.MouseEvent, book: LibraryBook) => {