fix(training): segmentation card reads availableSegBlocks not availableBlocks

Both cards were reading the same availableBlocks field, so the segmentation
box always showed the kurrent recognition count. Use the correct
availableSegBlocks field from the training info response.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-13 17:54:20 +02:00
parent 063095f58c
commit a514cbca18

View File

@@ -15,7 +15,7 @@ interface Run {
}
interface TrainingInfo {
availableBlocks?: number;
availableSegBlocks?: number;
ocrServiceAvailable?: boolean;
runs?: Run[];
}
@@ -29,7 +29,7 @@ let { trainingInfo }: Props = $props();
let training = $state(false);
let successMessage = $state<string | null>(null);
const available = $derived(trainingInfo?.availableBlocks ?? 0);
const available = $derived(trainingInfo?.availableSegBlocks ?? 0);
const tooFewBlocks = $derived(available < 5);
const serviceDown = $derived(trainingInfo?.ocrServiceAvailable === false);
const disabled = $derived(training || tooFewBlocks || serviceDown);