Add backwards compatibility for average changes

This commit is contained in:
Emily Doherty 2024-11-03 16:29:31 -08:00
parent 0180e8a3b5
commit 8c8499fb1c

View File

@ -165,9 +165,13 @@ function detectTimeQuery(urlSearchParams) {
}
function detectAggregateQuery(urlSearchParams) {
const validOperations = ['none', 'daily_mean'];
const validOperations = ['none', 'daily_mean', 'avg'];
if (validOperations.includes(urlSearchParams.get('aggregate').toLowerCase())) {
currentAggregateSelection = urlSearchParams.get('aggregate').toLowerCase();
// For backwards compatibility
if (currentAggregateSelection === 'daily_mean') {
currentAggregateSelection = 'avg';
}
let aggregateDDL = document.getElementById('aggregate');
for (let i = 0; i < aggregateDDL.options.length; i++) {
if (aggregateDDL.options[i].value === currentAggregateSelection) {