Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-02 17:33:16 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-02 17:33:16 -0700
commitbb403234f7d748499091e84a5f80d2f1394a4dc3 (patch)
tree7b60bba9d0152b841f9d12f24f5a3265a86f2d4a /src
parent5f17d5d786af74bb7b6bd6f99bcd0ccfab4fc9d5 (diff)
Fix deselecting when counter is not on the board
Diffstat (limited to 'src')
-rw-r--r--src/modules/gameboard.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/gameboard.js b/src/modules/gameboard.js
index a6b3e22..be725b5 100644
--- a/src/modules/gameboard.js
+++ b/src/modules/gameboard.js
@@ -171,7 +171,7 @@ function selectOffBoard() {
function select(data) {
const counter = data && (soldier.getCounter(svg, data) || soldier.createCounter(data));
- const isSelected = counter?.classList.contains(soldier.getSelectedClass());
+ const isSelected = data && data.classList && data.classList.contains('selected');
deselect();