From db17504ea0426d3269f599d8fc3375414903e700 Mon Sep 17 00:00:00 2001 From: Ada Werefox Date: Thu, 25 Apr 2024 22:02:57 -0500 Subject: [PATCH] Fixed an error where checks were being compared against "Undefined" due to lack of integer parsing in the update_breakdown() function. --- .../tracker/static/tracker/assets/main.js | 12 +++++++----- .../templates/tracker/settings/index.html | 18 +++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/tunictracker/tracker/static/tracker/assets/main.js b/tunictracker/tracker/static/tracker/assets/main.js index 3af87f4..ef93961 100644 --- a/tunictracker/tracker/static/tracker/assets/main.js +++ b/tunictracker/tracker/static/tracker/assets/main.js @@ -930,12 +930,12 @@ async function update_breakdown(scene, checks, entrances) { // Check for changes, and if so, update if ( - breakdown_checks.dataset.checksCollected != + parseInt(breakdown_checks.dataset.checksCollected) != checks.collected + checks.found ) { update_breakdown_checks(scene, checks); } - if (breakdown_entrances.dataset.entrancesFound != entrances.found) { + if (parseInt(breakdown_entrances.dataset.entrancesFound) != entrances.found) { update_breakdown_entrances(scene, entrances); } } @@ -945,9 +945,11 @@ async function update_breakdown_list(data, changed) { if (changed.checks) { Object.keys(data.scenes).forEach((scene) => update_breakdown(scene, data.scenes[scene], { - found: document.querySelector( - `.breakdown[data-scene="${scene}"] .breakdown-block-entrances-title` - ).dataset.entrancesFound, + found: parseInt( + document.querySelector( + `.breakdown[data-scene="${scene}"] .breakdown-block-entrances-title` + ).dataset.entrancesFound + ), }) ); } else if (changed.entrances) { diff --git a/tunictracker/tracker/templates/tracker/settings/index.html b/tunictracker/tracker/templates/tracker/settings/index.html index c1e56fc..88b9d1b 100644 --- a/tunictracker/tracker/templates/tracker/settings/index.html +++ b/tunictracker/tracker/templates/tracker/settings/index.html @@ -1,13 +1,13 @@
- - {% csrf_token %} - - {% for field in backend_filepath_form %}{{ field }}{% endfor %} - + + {% csrf_token %} + + {% for field in backend_filepath_form %}{{ field }}{% endfor %} +