From ca00ae945f9778f04353e97c4fcab3e59fe73949 Mon Sep 17 00:00:00 2001 From: LeJeu <64744459+le-jeu@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:49:30 +0200 Subject: [PATCH] fix: remove excluded portals when dialog is open --- src/code/dialogs/autodraws/tools.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/code/dialogs/autodraws/tools.js b/src/code/dialogs/autodraws/tools.js index 68c58cb40..2c304fb35 100644 --- a/src/code/dialogs/autodraws/tools.js +++ b/src/code/dialogs/autodraws/tools.js @@ -84,6 +84,17 @@ export const AutoDraw = WDialog.extend({ zone.contains(p.latLng) ); } + // Remove newly excluded portals + const excludes = new Set( + this._operation.markers + .filter( + (m) => m.type === WasabeeMarker.constants.MARKER_TYPE_EXCLUDE + ) + .map((m) => m.portalId) + ); + portalSet.portals = portalSet.portals.filter( + (p) => !excludes.has(p.id) + ); } } portalSet.display.textContent = wX("PORTAL_COUNT", {