Almost there

This commit is contained in:
Daniel Ledda
2020-11-14 16:18:27 +01:00
parent 73740fe114
commit e496296046

View File

@@ -45,7 +45,6 @@ class ClimateChart {
} }
private async getInitialDataBlob(): Promise<SnapshotRecords> { private async getInitialDataBlob(): Promise<SnapshotRecords> {
try {
const data = await fetch(this.rootUrl + "/data?since=" + new Date((new Date().getTime() - this.minutesDisplayed * 60 * 1000)).toISOString()); const data = await fetch(this.rootUrl + "/data?since=" + new Date((new Date().getTime() - this.minutesDisplayed * 60 * 1000)).toISOString());
const payload = await data.json(); const payload = await data.json();
if (payload.snapshots.length < 0) { if (payload.snapshots.length < 0) {
@@ -53,10 +52,6 @@ class ClimateChart {
} }
return payload; return payload;
} }
catch (e) {
throw e;
}
}
private async initChart() { private async initChart() {
const canvasElement = document.getElementById(this.canvasId); const canvasElement = document.getElementById(this.canvasId);