1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

handle @reboot

This commit is contained in:
Peter Clement 2024-02-12 15:31:19 +00:00
parent d2b3a7bdf2
commit 547b1ded61

View file

@ -8,6 +8,8 @@
export let value export let value
let error let error
const reboot = "@reboot"
$: { $: {
const exists = CRON_EXPRESSIONS.some(cron => cron.value === value) const exists = CRON_EXPRESSIONS.some(cron => cron.value === value)
const customIndex = CRON_EXPRESSIONS.findIndex( const customIndex = CRON_EXPRESSIONS.findIndex(
@ -22,7 +24,9 @@
} }
const onChange = e => { const onChange = e => {
error = helpers.cron.validate(e.detail).err if (value !== reboot) {
error = helpers.cron.validate(e.detail).err
}
if (e.detail === value || error) { if (e.detail === value || error) {
return return
} }
@ -57,7 +61,7 @@
if (!$flags.cloud) { if (!$flags.cloud) {
CRON_EXPRESSIONS.push({ CRON_EXPRESSIONS.push({
label: "Every Budibase Reboot", label: "Every Budibase Reboot",
value: "@reboot", value: reboot,
}) })
} }
}) })