diff --git a/src/components/DurationInput.vue b/src/components/DurationInput.vue index e91ada8..e644df3 100644 --- a/src/components/DurationInput.vue +++ b/src/components/DurationInput.vue @@ -392,6 +392,25 @@ async function createData() { } } +// Sync maxTotal/minTotal from props so calculateTotalSeconds can clamp +// and createData can initialize the display. +watch( + () => [props.max, props.updateMax], + ([max, updateMax]) => { + maxTotal.value = updateMax ?? max; + createData(); + }, + { immediate: true }, +); +watch( + () => [props.min, props.updateMin], + ([min, updateMin]) => { + minTotal.value = updateMin ?? min; + createData(); + }, + { immediate: true }, +); + // created emitter.on("reset", () => { createData();