mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
smaller security and memory improvements
This commit is contained in:
@@ -209,6 +209,13 @@ export default function ListingsTable() {
|
|||||||
|
|
||||||
const handleFilterChange = useMemo(() => debounce((value) => setFreeTextFilter(value), 500), []);
|
const handleFilterChange = useMemo(() => debounce((value) => setFreeTextFilter(value), 500), []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
// cleanup debounced handler to avoid memory leaks
|
||||||
|
handleFilterChange.cancel && handleFilterChange.cancel();
|
||||||
|
};
|
||||||
|
}, [handleFilterChange]);
|
||||||
|
|
||||||
const expandRowRender = (record) => {
|
const expandRowRender = (record) => {
|
||||||
return (
|
return (
|
||||||
<div className="listingsTable__expanded">
|
<div className="listingsTable__expanded">
|
||||||
@@ -235,7 +242,7 @@ export default function ListingsTable() {
|
|||||||
</Tag>
|
</Tag>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
<Descriptions.Item itemKey="Link">
|
<Descriptions.Item itemKey="Link">
|
||||||
<a href={record.link} target="_blank" rel="noreferrer">
|
<a href={record.link} target="_blank" rel="noopener noreferrer">
|
||||||
Link to Listing
|
Link to Listing
|
||||||
</a>
|
</a>
|
||||||
</Descriptions.Item>
|
</Descriptions.Item>
|
||||||
|
|||||||
@@ -79,8 +79,12 @@ export default function ProcessingTimes({ processingTimes = {} }) {
|
|||||||
icon={<IconPlayCircle />}
|
icon={<IconPlayCircle />}
|
||||||
aria-label="Start now"
|
aria-label="Start now"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
try {
|
||||||
await xhrPost('/api/jobs/startAll', null);
|
await xhrPost('/api/jobs/startAll', null);
|
||||||
Toast.success('Successfully triggered Fredy search.');
|
Toast.success('Successfully triggered Fredy search.');
|
||||||
|
} catch {
|
||||||
|
Toast.error('Failed to trigger search');
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Search now
|
Search now
|
||||||
|
|||||||
Reference in New Issue
Block a user