Remove unused aggregate function toggle

(cherry picked from commit 367b767f52)
This commit is contained in:
Emily Doherty 2024-10-17 00:05:37 -07:00
parent 2e020633b5
commit b8d11b3815

View File

@ -69,25 +69,6 @@ async function updateRegionalToken(region, data) {
} }
} }
async function aggregateFunctionToggle() {
// TODO: We should probably make these global or something
// so if the need to be updated in the future we can do so easily
const smallTimes = ['72h', '168h', '336h'];
const longTimes = ['720h', '30d', '2190h', '90d', '1y', '2y', '6m', 'all'];
const idsToModify = ['agg_wavg']
if (smallTimes.includes(currentTimeSelection)) {
for (const id of idsToModify) {
let ele = document.getElementById(id);
ele.disabled = true;
}
} else if (longTimes.includes(currentTimeSelection)) {
for (const id of idsToModify) {
let ele = document.getElementById(id);
ele.disabled = false;
}
}
}
async function updateRegionPreference(newRegion) { async function updateRegionPreference(newRegion) {
if (newRegion !== currentRegionSelection) { if (newRegion !== currentRegionSelection) {
await chart.destroyChart(); await chart.destroyChart();
@ -104,7 +85,6 @@ async function updateTimePreference(newTime) {
await chart.destroyChart(); await chart.destroyChart();
addLoader(); addLoader();
currentTimeSelection = newTime; currentTimeSelection = newTime;
await aggregateFunctionToggle();
} }
chart = new TokenChart(); chart = new TokenChart();
await pullChartData(); await pullChartData();
@ -195,7 +175,7 @@ function detectTimeQuery(urlSearchParams) {
} }
function detectAggregateQuery(urlSearchParams) { function detectAggregateQuery(urlSearchParams) {
const validOperations = ['none', 'daily_mean', 'weekly_mean']; const validOperations = ['none', 'daily_mean'];
if (validOperations.includes(urlSearchParams.get('aggregate').toLowerCase())) { if (validOperations.includes(urlSearchParams.get('aggregate').toLowerCase())) {
currentAggregateSelection = urlSearchParams.get('aggregate').toLowerCase(); currentAggregateSelection = urlSearchParams.get('aggregate').toLowerCase();
let aggregateDDL = document.getElementById('aggregate'); let aggregateDDL = document.getElementById('aggregate');
@ -204,7 +184,6 @@ function detectAggregateQuery(urlSearchParams) {
aggregateDDL.options[i].selected = true; aggregateDDL.options[i].selected = true;
} }
} }
aggregateFunctionToggle();
} else { } else {
console.warn("An incorrect or malformed aggregate selection was made in the query string"); console.warn("An incorrect or malformed aggregate selection was made in the query string");
} }