From 6531ee0923c636f7b125cdd194591cd91592225e Mon Sep 17 00:00:00 2001 From: bot-backend Date: Sat, 4 Jul 2026 01:13:18 +0300 Subject: [PATCH] =?UTF-8?q?fix(tradein/v2):=20=D0=B3=D0=B5=D0=B9=D1=82?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20PDF-=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D1=83?= =?UTF-8?q?=20=D0=BD=D0=B0=20hasEstimate=20(#2081=20M4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pdfHref вычислялся из currentEstimateId независимо от hasEstimate, из-за чего кнопка "СКАЧАТЬ PDF-ОТЧЁТ" оставалась активной в двух состояниях без валидного отчёта: insufficient-data (estimate_id есть, но результат неполный) и restore-404 (UUID-подобный id в URL, которого нет в БД). Остальные два контрола (ДЕЙСТВИТЕЛЕН ДО/КАК РАССЧИТАНО) уже были гейтнуты на тот же hasEstimate — теперь все три используют один источник истины. --- tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx b/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx index 10cd3e3b..45d2e4e5 100644 --- a/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx +++ b/tradein-mvp/frontend/src/components/trade-in/v2/HeroBar.tsx @@ -81,7 +81,7 @@ export default function HeroBar({ hasEstimate, onOpenInfo, }: HeroBarProps) { - const pdfHref = pdfDownloadHref(estimateId); + const pdfHref = hasEstimate ? pdfDownloadHref(estimateId) : null; // A downloadable report exists ⇔ the estimate is ready ⇒ the PDF button is the // filled/primary CTA (M4). Otherwise it stays a disabled outline. const pdfFilled = Boolean(pdfHref); -- 2.45.3