fix(cron): use getJobState helper in handlePauseResume
Self-review follow-up: handlePauseResume read job.state directly while the rest of the page goes through getJobState(), which falls back to the enabled flag when state is null/undefined. With the backend normalizer in this PR, state is always populated on the wire, so this has no observable effect today — but using the helper keeps the page consistent and resilient against older Hermes backends that don't run the normalizer.
This commit is contained in:
@@ -128,7 +128,7 @@ export default function CronPage() {
|
|||||||
|
|
||||||
const handlePauseResume = async (job: CronJob) => {
|
const handlePauseResume = async (job: CronJob) => {
|
||||||
try {
|
try {
|
||||||
const isPaused = job.state === "paused";
|
const isPaused = getJobState(job) === "paused";
|
||||||
if (isPaused) {
|
if (isPaused) {
|
||||||
await api.resumeCronJob(job.id);
|
await api.resumeCronJob(job.id);
|
||||||
showToast(
|
showToast(
|
||||||
|
|||||||
Reference in New Issue
Block a user