mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 20:32:12 +00:00
- update the audio inference component to use api manager to cancel job - update the audio inference component to reflect more job statuses --------- Co-authored-by: wil <wil@storyteller.ai>
18 lines
511 B
TypeScript
18 lines
511 B
TypeScript
import { ToastTypes } from "~/enums";
|
|
import { addToast, setJobs } from "~/signals";
|
|
import { JobsApi } from "~/Classes/ApiManager/JobsApi";
|
|
export async function PollRecentJobs() {
|
|
const jobsApi = new JobsApi();
|
|
|
|
const response = await jobsApi.ListRecentJobs();
|
|
if (response.success && response.data) {
|
|
setJobs(response.data);
|
|
// else, just no jobs, not an error, do nothing
|
|
return;
|
|
}
|
|
addToast(
|
|
ToastTypes.ERROR,
|
|
response.errorMessage || "Unknown Error: List Recent Jobs",
|
|
);
|
|
}
|