Remove unused aggregate function toggle
This commit is contained in:
parent
c9e14e265f
commit
367b767f52
23
src/index.js
23
src/index.js
@ -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");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user