Fix web push delivery handling and worker console
Some checks failed
docker-images / resolve-build-targets (push) Successful in 5s
docker-images / build-and-push (admin) (push) Successful in 30s
docker-images / submit-indexnow (push) Has been cancelled
docker-images / build-and-push (frontend) (push) Has been cancelled
docker-images / build-and-push (backend) (push) Has been cancelled
Some checks failed
docker-images / resolve-build-targets (push) Successful in 5s
docker-images / build-and-push (admin) (push) Successful in 30s
docker-images / submit-indexnow (push) Has been cancelled
docker-images / build-and-push (frontend) (push) Has been cancelled
docker-images / build-and-push (backend) (push) Has been cancelled
This commit is contained in:
@@ -114,3 +114,14 @@ export function formatWorkerProgress(
|
||||
|
||||
return progress.message ?? (details || null);
|
||||
}
|
||||
|
||||
export function getWorkerProgressPercent(
|
||||
job: Pick<WorkerJobRecord, "result">,
|
||||
): number | null {
|
||||
const progress = getWorkerProgress(job);
|
||||
if (typeof progress?.percent !== "number") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Math.max(0, Math.min(100, Math.round(progress.percent)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user