18 - Allow setting allocation value after type change

This commit is contained in:
myrmidex 2026-03-22 02:07:26 +01:00
parent aca9644c5b
commit 52ec8bb2ac

View file

@ -342,17 +342,17 @@ export default function Show({ scenario, buckets, streams = { data: [] }, stream
<div className="mt-2">
<span className="text-sm text-gray-600">
Allocation:{' '}
{bucket.allocation_type === 'fixed_limit' && bucket.allocation_value !== null ? (
{bucket.allocation_type === 'fixed_limit' ? (
<InlineEditInput
value={centsToDollars(bucket.allocation_value)}
value={centsToDollars(bucket.allocation_value ?? 0)}
onSave={(val) => patchBucket(bucket.id, { allocation_value: dollarsToCents(val) })}
formatDisplay={(v) => `$${v.toFixed(2)}`}
min={0}
step="0.01"
/>
) : bucket.allocation_type === 'percentage' && bucket.allocation_value !== null ? (
) : bucket.allocation_type === 'percentage' ? (
<InlineEditInput
value={basisPointsToPercent(bucket.allocation_value)}
value={basisPointsToPercent(bucket.allocation_value ?? 0)}
onSave={(val) => patchBucket(bucket.id, { allocation_value: percentToBasisPoints(val) })}
formatDisplay={(v) => `${v.toFixed(2)}%`}
min={0}