attempt to fix job-list reload bug

This commit is contained in:
Ramnique Singh 2025-08-13 11:56:35 +05:30
parent c94f96fb32
commit 6b49872154
2 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,6 @@
'use client';
import { useEffect, useState } from "react";
import { useEffect, useMemo, useState } from "react";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";
import { Panel } from "@/components/common/panel-common";
@ -20,6 +20,8 @@ export function RecurringJobRuleView({ projectId, ruleId }: { projectId: string;
const [deleting, setDeleting] = useState(false);
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
const jobsFilters = useMemo(() => ({ recurringJobRuleId: ruleId }), [ruleId]);
useEffect(() => {
const loadRule = async () => {
try {
@ -272,7 +274,7 @@ export function RecurringJobRuleView({ projectId, ruleId }: { projectId: string;
</h3>
<JobsList
projectId={projectId}
filters={{ recurringJobRuleId: ruleId }}
filters={jobsFilters}
showTitle={false}
/>
</div>

View file

@ -50,7 +50,7 @@ export function JobsList({ projectId, filters, showTitle = true, customTitle }:
setLoading(false);
})();
return () => { ignore = true; };
}, [fetchPage, filters]);
}, [fetchPage]);
const loadMore = useCallback(async () => {
if (!cursor) return;