Skip to content

Commit d4d1a19

Browse files
Clarify checkbox state initialization logic
Co-authored-by: jamesmontemagno <1676321+jamesmontemagno@users.noreply.github.com>
1 parent 18db357 commit d4d1a19

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

docs/step.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,10 @@
262262
if (checkboxes.length === 0) return;
263263

264264
const allState = readCheckboxState();
265-
const stepState = Array.isArray(allState[stepId]) ? allState[stepId] : (allState[stepId] = []);
265+
if (!Array.isArray(allState[stepId])) {
266+
allState[stepId] = [];
267+
}
268+
const stepState = allState[stepId];
266269

267270
checkboxes.forEach((checkbox, index) => {
268271
checkbox.disabled = false;

0 commit comments

Comments
 (0)