Fixed bad function ref
This commit is contained in:
2
webapp/dist/main.js
vendored
2
webapp/dist/main.js
vendored
File diff suppressed because one or more lines are too long
@@ -52,13 +52,12 @@ class ClimateChart {
|
|||||||
throw new Error(`improper HTML element passed, needed type canvas, got ${canvasElement.tagName}`);
|
throw new Error(`improper HTML element passed, needed type canvas, got ${canvasElement.tagName}`);
|
||||||
}
|
}
|
||||||
this.chart = new Chart(ctx, generateClimateChartConfig({}));
|
this.chart = new Chart(ctx, generateClimateChartConfig({}));
|
||||||
setInterval(this.doUpdateInterval, 30 * 1000);
|
await this.update();
|
||||||
await this.doUpdateInterval();
|
|
||||||
this.onLoadedCallback();
|
this.onLoadedCallback();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async doUpdateInterval() {
|
async update() {
|
||||||
await this.updateFromServer().catch(e => this.logError(e));
|
return this.updateFromServer().catch(e => this.logError(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getNewSnapshots(): Promise<SnapshotRecords> {
|
private async getNewSnapshots(): Promise<SnapshotRecords> {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ document.onreadystatechange = (e) => {
|
|||||||
const climateChart = createClimateChart();
|
const climateChart = createClimateChart();
|
||||||
climateChart.onLoaded(() => {
|
climateChart.onLoaded(() => {
|
||||||
overlay.classList.add('hidden');
|
overlay.classList.add('hidden');
|
||||||
|
setInterval(() => climateChart.update(), 30 * 1000);
|
||||||
});
|
});
|
||||||
climateChart.onErrored((e) => {
|
climateChart.onErrored((e) => {
|
||||||
overlay.classList.remove('hidden');
|
overlay.classList.remove('hidden');
|
||||||
|
|||||||
Reference in New Issue
Block a user