Skip to content

Commit b2c1c83

Browse files
author
jacquesbach
committed
Prevent duplicate hourly-heatmap initialization
1 parent 6ae4ce8 commit b2c1c83

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

static/js/script.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,11 @@ document.getElementById("heatmapYearSelect")
732732

733733
document.addEventListener("DOMContentLoaded", initHeatmapYears);
734734

735+
let heatmapInitialized = false;
736+
735737
async function initHourlyHeatmap() {
738+
if (heatmapInitialized) return;
739+
heatmapInitialized = true;
736740
const res = await fetch("/api/heatmap_hourly");
737741
const data = await res.json();
738742

templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ <h1>
162162
</div>
163163
</div>
164164
</div>
165-
<strong>test</strong>
165+
166166
<div class="grid-stack-item" id="card-hourly-heatmap" gs-w="15" gs-h="7">
167167
<div class="grid-stack-item-content">
168168
<div class="card card-light heatmap-card" style="height: 100%; box-sizing: border-box; position: relative;">

0 commit comments

Comments
 (0)