mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 10:50:38 +09:00
Fix stale issue live-run state
This commit is contained in:
parent
2172476e84
commit
ab5eeca94e
3 changed files with 65 additions and 2 deletions
15
ui/src/lib/issueActiveRun.ts
Normal file
15
ui/src/lib/issueActiveRun.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import type { Issue } from "@paperclipai/shared";
|
||||
import type { ActiveRunForIssue } from "../api/heartbeats";
|
||||
|
||||
export function shouldTrackIssueActiveRun(
|
||||
issue: Pick<Issue, "status" | "executionRunId"> | null | undefined,
|
||||
): boolean {
|
||||
return Boolean(issue && (issue.status === "in_progress" || issue.executionRunId));
|
||||
}
|
||||
|
||||
export function resolveIssueActiveRun(
|
||||
issue: Pick<Issue, "status" | "executionRunId"> | null | undefined,
|
||||
activeRun: ActiveRunForIssue | null | undefined,
|
||||
): ActiveRunForIssue | null {
|
||||
return shouldTrackIssueActiveRun(issue) ? (activeRun ?? null) : null;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue