Files
ArchiTools/src/modules/geoportal
Claude VM 36840f31f6 fix(geoportal-v2): gate condo-owners on IS_CONDOMINIUM + visible empty state
Two issues from Marius's cladiri screenshots:

1. APARTAMENTE "se încarcă…" sat for ~10s then vanished
   — useEffect fired for every CLADIRI click regardless of whether
   the building was actually a condo. Orchestrator's
   /api/v1/building/condo-owners hit eTerra live, got back an empty
   list for non-condos, returned [], section auto-hid → user saw the
   spinner blink and disappear.

   New gate: useEffect waits for `detail` to land, then reads
   IS_CONDOMINIUM / PARCEL_IS_CONDOMINIUM from enrichment. If neither
   is `1`, skip the fetch entirely. Non-condos no longer pay the 10s
   eTerra round-trip just to show nothing.

2. EMPTY CONDO LISTS WERE HIDING SILENTLY
   — for buildings flagged condo where ANCPI hasn't registered units
   yet, the section would still vanish (`condoOwners.length > 0`
   check). Now: if the fetch returns []  AND the building is a
   condo, render the section with "Fără apartamente înregistrate la
   ANCPI." That's the truthful UX. Same fallback when the fetch
   errors — treat as empty rather than swallow.

Render trigger flipped from
  (condoLoading || (condoOwners && condoOwners.length > 0))
to
  (condoLoading || condoOwners != null)
so the section shows whenever the gate decided to fetch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:03:18 +03:00
..