fix: resolve eslint warnings in NewsSection and AdminTickets

NewsSection: wrap items in useMemo to stabilize dependency reference.
AdminTickets: copy ref values to local vars for cleanup function.
This commit is contained in:
c0mrade
2026-03-25 11:47:41 +03:00
parent fd01c0f393
commit e86b214008
2 changed files with 6 additions and 4 deletions

View File

@@ -369,7 +369,7 @@ export default function NewsSection() {
gcTime: 10 * 60_000,
});
const items = data?.items ?? [];
const items = useMemo(() => data?.items ?? [], [data?.items]);
const total = data?.total ?? 0;
const categories = data?.categories ?? [];

View File

@@ -181,10 +181,12 @@ export default function AdminTickets() {
// Cancel in-flight uploads and cleanup blob URL on unmount
useEffect(() => {
const uploadRef = uploadIdRef;
const prevRef = previewRef;
return () => {
uploadIdRef.current++;
if (previewRef.current) {
URL.revokeObjectURL(previewRef.current);
uploadRef.current++;
if (prevRef.current) {
URL.revokeObjectURL(prevRef.current);
}
};
}, []);