Skip to content

Commit 637ee57

Browse files
committed
fix(useToolkitShutdownForm): Update repeatMode logic to handle unsupported modes
- Modified the repeatMode assignment to set it to 'none' for unsupported modes, ensuring consistent behavior in the toolkit shutdown form. - This change improves the robustness of the form by preventing unexpected values in repeatMode.
1 parent e915832 commit 637ee57

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/composables/useToolkitShutdownForm.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ export function useToolkitShutdownForm(options: UseToolkitShutdownFormOptions) {
267267
}
268268
withDateSyncSuspended(() => {
269269
setAppointmentFromDate(base);
270-
repeatMode.value = currentPlan.mode;
270+
if (currentPlan.mode === 'daily' || currentPlan.mode === 'weekly' || currentPlan.mode === 'monthly') {
271+
repeatMode.value = currentPlan.mode;
272+
} else {
273+
repeatMode.value = 'none';
274+
}
271275
if (currentPlan.mode === 'weekly') {
272276
weeklyDay.value = clampInt(currentPlan.weekday ?? weeklyDay.value, 1, 7);
273277
}

0 commit comments

Comments
 (0)