mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-25 18:55:19 +02:00
attempt to fix job-list reload bug
This commit is contained in:
parent
c94f96fb32
commit
6b49872154
2 changed files with 5 additions and 3 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue