fix: keep a custom recurrence rule when the editor reopens it (#29260)

Loading an automation whose rule the visual controls cannot represent switched the schedule to Custom but left the bookkeeping the seeding block reads on the previous value, so that block immediately replaced the rule with a freshly built default. The rule was lost when the editor opened, before anything was saved, and cloning carried the default across as well. Recording the switch alongside it leaves the stored rule in place.

Verified in a browser against the same build without this line: a minutely rule and a yearly rule now survive reopen and save byte for byte, cloning keeps the original, and every schedule the editor itself produces, along with switching to Custom by hand, behaves exactly as before.
This commit is contained in:
Classic298
2026-08-31 00:08:28 -05:00
committed by GitHub
parent 1976387808
commit b75e2670b7
@@ -128,6 +128,7 @@
const freq = parts.FREQ || 'DAILY';
if (!['HOURLY', 'DAILY', 'WEEKLY', 'MONTHLY'].includes(freq)) {
frequency = 'CUSTOM';
prevFrequency = 'CUSTOM';
customRrule = s;
return;
}