fixed updating charts with selected time range
Build and Push Docker Image / build-and-push (pull_request) Successful in 1m7s
Python Code Quality / python-code-quality (pull_request) Successful in 10s
Python Test / python-test (pull_request) Successful in 17s

This commit is contained in:
Brian Bjarke Jensen
2025-11-13 14:10:09 +01:00
parent 6de91fa6a9
commit f4419f6a72
+10 -4
View File
@@ -345,13 +345,16 @@
}
}
document
.getElementById("timeRangeFilter")
.addEventListener("change", function () {
function attachTimeRangeListener() {
const timeRangeFilter = document.getElementById("timeRangeFilter");
if (timeRangeFilter) {
timeRangeFilter.addEventListener("change", function () {
// Save selection to localStorage
localStorage.setItem("lastSleepTimeRange", this.value);
loadData();
renderCharts();
});
}
}
async function loadData() {
try {
@@ -443,6 +446,9 @@
attachChildFilterListener();
}
// Always attach time range listener after recreating the controls
attachTimeRangeListener();
renderCharts();
} catch (error) {
console.error("Error loading data:", error);