mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-08-01 10:37:14 -04:00
14 lines
384 B
TypeScript
14 lines
384 B
TypeScript
import type { TaskOutcome, TaskResult } from "~/schemas/tasks";
|
|
|
|
export const getCompletedTaskOutcome = (result: TaskResult): TaskOutcome => {
|
|
if (result.kind === "backup" && result.warningDetails !== null) {
|
|
return "warning";
|
|
}
|
|
|
|
if (result.kind === "doctor" && (result.repositoryStatus === "error" || !result.doctorResult.success)) {
|
|
return "error";
|
|
}
|
|
|
|
return "success";
|
|
};
|