mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
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:
@@ -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 ?? [];
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user