fix: count salad slot on warning

This commit is contained in:
2025-11-04 23:51:28 +01:00
parent a1cb638e4b
commit ea54573cac
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -46,7 +46,7 @@
<td><input v-model="config.duration" id="duration" type="range" min="5" v-bind:max="totalDuration" step="5" />
</td>
<td>
<span v-if="(totalDuration / config.duration) < candidates.length" title="slot duration might be too big">
<span v-if="slotTooBig" title="slot duration might be too big">
<i icon="triangle-alert"></i> {{config.duration}} minutes
</span>
<span v-else>
+9
View File
@@ -262,6 +262,15 @@ const app = createApp({
value.length && array.indexOf(value) === index
);
},
slotTooBig() {
const slotCount = this.totalDuration / this.config.duration;
if (this.config.endWithAll) {
return slotCount - 1 < this.candidates.length;
}
return slotCount < this.candidates.length;
},
},
watch: {
vegetable() {