fix(tracker): live sync label truncation and due_day fallback on partial update
- Shorten 'Live Sync' label to 'Live' for space-constrained layouts - Add existing bill due_day fallback in validateBillData to prevent spurious required-field errors during partial PATCH updates (batch 0.37.2)
This commit is contained in:
parent
80ef1208ae
commit
626459322f
|
|
@ -813,7 +813,7 @@ export default function TrackerPage() {
|
||||||
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75" />
|
<span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-emerald-400 opacity-75" />
|
||||||
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500" />
|
<span className="relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500" />
|
||||||
</span>
|
</span>
|
||||||
Live Sync
|
Live
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-[1.75rem] font-bold tracking-tight font-mono leading-none text-foreground">
|
<p className="text-[1.75rem] font-bold tracking-tight font-mono leading-none text-foreground">
|
||||||
|
|
|
||||||
|
|
@ -254,9 +254,13 @@ function validateBillData(data, existingBill = null) {
|
||||||
}
|
}
|
||||||
normalized.name = nameVal || null;
|
normalized.name = nameVal || null;
|
||||||
|
|
||||||
// due_day is required
|
// due_day is required; fall back to existing value on partial updates
|
||||||
if (data.due_day === undefined || data.due_day === null) {
|
if (data.due_day === undefined || data.due_day === null) {
|
||||||
errors.push({ field: 'due_day', message: 'due_day is required' });
|
if (existingBill?.due_day != null) {
|
||||||
|
normalized.due_day = existingBill.due_day;
|
||||||
|
} else {
|
||||||
|
errors.push({ field: 'due_day', message: 'due_day is required' });
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
const dueResult = parseDueDay(data.due_day);
|
const dueResult = parseDueDay(data.due_day);
|
||||||
if (dueResult.error) {
|
if (dueResult.error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue