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';
|
'use client';
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Panel } from "@/components/common/panel-common";
|
import { Panel } from "@/components/common/panel-common";
|
||||||
|
|
@ -20,6 +20,8 @@ export function RecurringJobRuleView({ projectId, ruleId }: { projectId: string;
|
||||||
const [deleting, setDeleting] = useState(false);
|
const [deleting, setDeleting] = useState(false);
|
||||||
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
|
||||||
|
|
||||||
|
const jobsFilters = useMemo(() => ({ recurringJobRuleId: ruleId }), [ruleId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const loadRule = async () => {
|
const loadRule = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -272,7 +274,7 @@ export function RecurringJobRuleView({ projectId, ruleId }: { projectId: string;
|
||||||
</h3>
|
</h3>
|
||||||
<JobsList
|
<JobsList
|
||||||
projectId={projectId}
|
projectId={projectId}
|
||||||
filters={{ recurringJobRuleId: ruleId }}
|
filters={jobsFilters}
|
||||||
showTitle={false}
|
showTitle={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ export function JobsList({ projectId, filters, showTitle = true, customTitle }:
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
})();
|
})();
|
||||||
return () => { ignore = true; };
|
return () => { ignore = true; };
|
||||||
}, [fetchPage, filters]);
|
}, [fetchPage]);
|
||||||
|
|
||||||
const loadMore = useCallback(async () => {
|
const loadMore = useCallback(async () => {
|
||||||
if (!cursor) return;
|
if (!cursor) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue