fix(tradein/v2): reset map CDN-error flag on retry
All checks were successful
CI Trade-In / changes (pull_request) Successful in 9s
CI / changes (pull_request) Successful in 12s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Successful in 1m14s
All checks were successful
CI Trade-In / changes (pull_request) Successful in 9s
CI / changes (pull_request) Successful in 12s
CI Trade-In / backend-tests (pull_request) Has been skipped
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
CI Trade-In / frontend-checks (pull_request) Successful in 1m14s
Без сброса ветка ошибки — тупик: она подменяет контейнер карты в дереве рендера, поэтому mapContainerRef остаётся null и повторная попытка не может удаться. Один сбой unpkg убивал карту до перезагрузки страницы, даже после выбора другого адреса. Найдено на pre-push ревью.
This commit is contained in:
parent
a1e12db72f
commit
99f1a4a733
1 changed files with 7 additions and 0 deletions
|
|
@ -911,6 +911,13 @@ export default function ParamsPanel({
|
|||
let map: any = null;
|
||||
let cancelled = false;
|
||||
|
||||
// Reset a previous CDN failure before retrying. Without this the error
|
||||
// branch is a dead end: it replaces the map container in the render tree,
|
||||
// so mapContainerRef stays null and no later attempt can ever succeed —
|
||||
// one transient unpkg blip would kill the map for the rest of the session
|
||||
// even after the user picks a different address.
|
||||
setMapLoadError(false);
|
||||
|
||||
loadLeaflet()
|
||||
.then((L) => {
|
||||
if (cancelled || !mapContainerRef.current || !coordsRef.current) return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue