From 389bf932aeb996c204518da63cca727cd1a2aef3 Mon Sep 17 00:00:00 2001 From: "F.W. Dekker" Date: Sun, 14 Nov 2021 11:15:30 +0100 Subject: [PATCH] Prevent removing row even if not original row --- package.json | 2 +- src/main/js/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0daaca4..4ff21d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dice", - "version": "1.0.16", + "version": "1.0.17", "description": "Calculates the probability of rolling a value given a combination of dice.", "author": "F.W. Dekker", "browser": "dist/bundle.js", diff --git a/src/main/js/main.js b/src/main/js/main.js index 91ef3cf..5caf30c 100644 --- a/src/main/js/main.js +++ b/src/main/js/main.js @@ -126,7 +126,7 @@ inputTable.addDieRow = () => { }; inputTable.removeDieRow = index => { - if (inputTable.highestDieRowIndex() > 0) { + if (inputTable.dieRowCount() > 1) { const table = inputTable.getTable(); const row = table.querySelector("tr[data-index=\"" + index + "\"]"); row.parentElement.removeChild(row);