Fix cancel firing arc placement bug

This commit is contained in:
Catalin Constantin Mititiuc 2025-06-16 22:41:29 -07:00
parent 8970c1f59e
commit 0af0271076
2 changed files with 2 additions and 2 deletions

View File

@ -294,7 +294,7 @@ function set(svg, size, counter, { x, y }) {
function cancelPlacementListener(e) { function cancelPlacementListener(e) {
e.preventDefault(); e.preventDefault();
get(counter).forEach(el => el.remove()); get(svg, counter).forEach(el => el.remove());
grid.removeAttribute('style'); grid.removeAttribute('style');
svg.removeEventListener('mousemove', positionListener); svg.removeEventListener('mousemove', positionListener);
} }

View File

@ -222,7 +222,7 @@ export function start(el) {
const toPlace = placing.pop(), const toPlace = placing.pop(),
occupant = getCellOccupant(cell); occupant = getCellOccupant(cell);
if (toPlace && occupant && toPlace == occupant) { if (toPlace && occupant && toPlace === occupant) {
const { number, allegiance } = toPlace.dataset, const { number, allegiance } = toPlace.dataset,
selector = `[data-allegiance="${allegiance}"][data-number="${number}"]`; selector = `[data-allegiance="${allegiance}"][data-number="${number}"]`;