fixed a cache issue

This commit is contained in:
2026-02-24 22:25:14 -08:00
parent 8ded70b743
commit 03ee2b3645

View File

@@ -375,14 +375,17 @@ function loadYear(year){
document.getElementById('filterArea').innerHTML = '<option value="">All Areas</option>'; document.getElementById('filterArea').innerHTML = '<option value="">All Areas</option>';
document.getElementById('filterCuisine').innerHTML = '<option value="">All Cuisines</option>'; document.getElementById('filterCuisine').innerHTML = '<option value="">All Cuisines</option>';
resetFilters(); resetFilters();
fetch(year+'-restaurants.json') fetch(year+'-restaurants.json', {cache:'no-store'})
.then(function(r){ return r.json(); }) .then(function(r){ return r.json(); })
.then(function(data){ .then(function(data){
RESTAURANTS = data.restaurants; RESTAURANTS = Array.isArray(data) ? data : data.restaurants;
document.getElementById('eventDates').textContent = data.eventDates; if(data.eventDates) document.getElementById('eventDates').textContent = data.eventDates;
initDropdowns(); initDropdowns();
applyFilters(); applyFilters();
updateCounts(); updateCounts();
})
.catch(function(err){
document.getElementById('listPanel').innerHTML = '<div class="no-results">⚠️ Failed to load restaurant data.<br><small>'+err+'</small><br><small>Try serving this file from a local web server instead of opening it directly.</small></div>';
}); });
} }