Cache API calls
This commit is contained in:
fraxle
2026-05-21 18:48:10 +01:00
parent 073e6c6b23
commit d6eedabbf9
4 changed files with 92 additions and 48 deletions
+3 -1
View File
@@ -43,7 +43,7 @@ export function UTCIForecast() {
// useAppState. See hooks/useAppState.js for the full reading order.
const {
location, setLocationAndSave,
forecast, airQuality, loading, error, now,
forecast, airQuality, loading, error, now, fetchedAt,
searchQuery, setSearchQuery, searchResults, searching,
selectedDay, setSelectedDay,
proPromptDay, setProPromptDay,
@@ -198,6 +198,8 @@ export function UTCIForecast() {
${location.lat.toFixed(3)}°, ${location.lon.toFixed(3)}°
</span>
</div>
${fetchedAt && !loading && html`
<div class="utci-fetch-time">Last update: ${fetchedAt.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}</div>`}
</div>
<div>