e the button if enough time has passed
        }
      }

      async function fetchHeartRateData() {
        try {
          const response = await fetch("/metrics/data/read");
          if (!response.ok) {
            throw new Error("Network response was not ok");
          }
          const data = await response.json();

          heartRateData = data;

          // Always update the last data timestamp from the actual data
          if (data.length > 0) {
            const lastDataPoint = data[data.len