Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(budget): show the link controls on an explicit null check

Maurice287b84875bc9
diff --git a/client/src/components/Planner/BookingCostsSection.tsx b/client/src/components/Planner/BookingCostsSection.tsx
index f8c5e9bec..af3cb7278 100644
--- a/client/src/components/Planner/BookingCostsSection.tsx
+++ b/client/src/components/Planner/BookingCostsSection.tsx
@@ -100,7 +100,7 @@ export function BookingCostsSection({ reservationId, placeId = null, hintKey = '
<Plus size={14} /> {t('reservations.createExpense')}
</button>
{/* Linking needs the record to exist, so it waits for the first save. */}
- {targetId && (
+ {targetId !== null && (
<CustomSelect
value=""
onChange={value => {
diff --git a/client/src/mobile/screens/trip/sheets/MLinkedCosts.tsx b/client/src/mobile/screens/trip/sheets/MLinkedCosts.tsx
index 1a1dbe1d0..ab4862348 100644
--- a/client/src/mobile/screens/trip/sheets/MLinkedCosts.tsx
+++ b/client/src/mobile/screens/trip/sheets/MLinkedCosts.tsx
@@ -92,7 +92,7 @@ export default function MLinkedCosts({ reservationId = null, placeId = null, hin
{t('reservations.createExpense')}
</button>
{/* Linking needs the record to exist, so it waits for the first save. */}
- {targetId && (
+ {targetId !== null && (
<button type="button" onClick={() => setPicking(v => !v)} aria-expanded={picking} className={`${PILL_CLS} ${picking ? '!bg-m-act !text-m-actfg' : ''}`}>
<Link2 size={13} strokeWidth={2.2} />
{t('files.link')}
@@ -100,7 +100,7 @@ export default function MLinkedCosts({ reservationId = null, placeId = null, hin
)}
</div>
- {picking && targetId && (
+ {picking && targetId !== null && (
<div className="mt-2 rounded-[13px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-1">
{unlinked.length >= SEARCH_FROM && (
<div className="mx-1 mb-1 mt-1 flex items-center gap-2 rounded-[10px] bg-[color:var(--m-ic)] px-[10px] py-[7px]">