From 15f0a697d8d66178604c3ae232aff0949181b632 Mon Sep 17 00:00:00 2001 From: Alix JEUDI--LEMOINE Date: Mon, 2 Jun 2025 10:33:56 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Clean=20up=20modals=20on=20pin=20lo?= =?UTF-8?q?ad=20by=20removing=20elements=20from=20the=20DOM=20when=20reloa?= =?UTF-8?q?ding=20pins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/leaflet-map/leaflet-map.component.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/components/leaflet-map/leaflet-map.component.ts b/src/app/components/leaflet-map/leaflet-map.component.ts index 5c5f8b8..f6610bf 100644 --- a/src/app/components/leaflet-map/leaflet-map.component.ts +++ b/src/app/components/leaflet-map/leaflet-map.component.ts @@ -310,6 +310,12 @@ export class LeafletMapComponent implements OnInit { public loadPins(): void { this.pinsService.getPins().subscribe((pins: Pin[]) => { + // Supprimer du body toutes les divs confirm-modal-* / share-modal-* / edit-pin-popup-* + const modals = document.querySelectorAll('div[id^="confirm-modal-"], div[id^="share-modal-"], div[id^="edit-pin-popup-"]'); + modals.forEach((modal) => { + modal.remove(); + }); + this.allPins = pins; this.extractPersons(pins); this.renderPins(); // Afficher d'abord les pins sans les filtres